var map;
var image;
var panzoom;
var lon = 113.844;
var lat = 34;
var zoom = 6;
var measureControls = null;
var boxControl = null;
var measureType = "";
var common = null;
var tucenglayer = null; ////单独图层
var searchMap = null;
var proximitySearch = null;
var routePlanner = null;
var busTransfer = null;
var mymap = null;
var searchsuggest = null;
var mapwrong = null;
var zoomBox = null;
var options = [];
var mapOerate = null;
var jpl = null;
var curPntList
	//20140902白
var markerr = Array();
var poijj = 1;
var k = 0;
var marker;
var markergroup; //数组
//
var ggpagecount = 0;
var ggpagesize = 10;
var ggcurrpage = 0;
var ggrowcount = 0;
var mingzi = "收费站";
///
var drawpoints = [];
var bVectorMap = true;
var state_cva, state_vec;
var matrixIds = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20'];
var resolutions = [0.703125, 0.3515625, 0.17578125, 0.087890625, 0.0439453125, 0.02197265625, 0.010986328125, 0.0054931640625, 0.00274658203125, 0.001373291015625, 0.0006866455078125, 0.00034332275390625, 0.000171661376953125, 8.58306884765625e-005, 4.291534423828125e-005, 2.1457672119140625e-005, 1.0728836059570313e-005, 5.36441802978515625e-006, 2.682209014892578e-006, 1.341104507446289e-006];
var state_vec_options = {
	name: "state_vec",
	url: "http://t1.tianditu.com/vec_c/wmts",
	layer: "vec",
	style: "default",
	format: "tiles",
	matrixIds: matrixIds,
	zoomOffset: 1,
	matrixSet: "c",
	buffer: 0,
	resolutions: resolutions
};
options["state_vec"] = state_vec_options;

var state_cva_options = {
	name: "state_cva",
	url: "http://t1.tianditu.com/cva_c/wmts",
	layer: "cva",
	style: "default",
	format: "tiles",
	matrixIds: matrixIds,
	zoomOffset: 1,
	matrixSet: "c",
	buffer: 0,
	resolutions: resolutions
};
options["state_cva"] = state_cva_options;

/////影像
var state_img_2013_options = {
	name: "state_img_2013",
	url: "http://t0.tianditu.com/img_c/wmts",
	layer: "img",
	style: "default",
	format: "tiles",
	matrixIds: matrixIds,
	zoomOffset: 1,
	matrixSet: "c",
	buffer: 0,
	resolutions: resolutions
};
options["state_img_2013"] = state_img_2013_options;

var state_cia_2013_options = {
	name: "state_cia_2013",
	url: "http://t0.tianditu.com/cia_c/wmts",
	layer: "cia",
	style: "default",
	format: "tiles",
	matrixIds: matrixIds,
	zoomOffset: 1,
	matrixSet: "c",
	buffer: 0,
	resolutions: resolutions
};

options["state_cia_2013"] = state_cia_2013_options;

var mark = null;
var ov = null;
var zoomBox = null;
var currNav = "f";
var FullScreen = false;


function load() {

	OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3;
	map = new OpenLayers.Map('map', {
		controls: [new OpenLayers.Control.Navigation({
			dragPanOptions: {
				enableKinetic: true
			}
		})],
		maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90)
	});
	LoadLayers();

	map.addControl(new OpenLayers.Control.PanZoomBarTitle({
		zoomWorldIcon: true
	}));
	map.addControl(new OpenLayers.Control.KeyboardDefaults());

	var touch = new OpenLayers.Control.TouchNavigation({
		dragPanOptions: {
			enableKinetic: true
		}
	});
	map.addControl(touch);

	map.addControl(new OpenLayers.Control.ScaleLine());
	map.addControl(new OpenLayers.Control.MagnifyingGlass());

	map.events.register("moveend", map, changeMapLayer);
	///	map.events.register("moveend", map, getScreenMarkers);
	initMeasureControls();

	map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);

	mapOerate = new MapOperate(map);


}

function load2() {


	OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3;
	map = new OpenLayers.Map('map', {
		controls: [new OpenLayers.Control.Navigation({
			dragPanOptions: {
				enableKinetic: true
			}
		})],
		maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90)
	});
	LoadLayers();

	map.addControl(new OpenLayers.Control.PanZoomBarTitle({
		zoomWorldIcon: true
	}));
	map.addControl(new OpenLayers.Control.KeyboardDefaults());

	var touch = new OpenLayers.Control.TouchNavigation({
		dragPanOptions: {
			enableKinetic: true
		}
	});
	map.addControl(touch);

	map.addControl(new OpenLayers.Control.ScaleLine());
	map.addControl(new OpenLayers.Control.MagnifyingGlass());
	//map.addControl(new OpenLayers.Control.LayerSwitcher());
	map.events.register("moveend", map, getScreenMarkers);

	initMeasureControls();

	map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
	mapOerate = new MapOperate(map);


}
OpenLayers.Util.onImageLoadError = function() {
	this._attempts = (this._attempts) ? (this._attempts + 1) : 1;
	// alert(this.imageReloadAttempts);
	if (this._attempts <= OpenLayers.IMAGE_RELOAD_ATTEMPTS) {
		//  alert(this.src);
		var src = this.src;
		var urls = src.split('?');
		if (urls instanceof Array && urls.length > 1) {
			var val_Url = urls[1];
			var val_Url_Array = val_Url.split('&');
			for (var k = 0; k < val_Url_Array.length; k++) {
				var current_Url = val_Url_Array[k];
				var urlArray = current_Url.split('=');
				if (urlArray.length > 1) {
					var name = urlArray[0];
					var val = urlArray[1];
					var lower_name = name.toLowerCase();
					if (lower_name == "layer") {
						if (val == "vec") {
							this.src = "openlayers/img/vec.jpg";
							break;
						} else if (val == "ter") {
							this.src = "openlayers/img/ter.jpg";
							break;
						} else {
							this.src = "openlayers/img/blank.gif";
							break;
						}
					}
				}
			}
		}

	} else {
		this.style.backgroundColor = OpenLayers.Util.onImageLoadErrorColor;
		this.src = "openlayers/img/blank.gif";
	}
	this.style.display = "";

};


function load1(name, xx, yy) {

	OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3;
	map = new OpenLayers.Map('mapdiv', {
		controls: [new OpenLayers.Control.Navigation({
			dragPanOptions: {
				enableKinetic: true
			}
		})],
		maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90)
	});
	LoadLayers();

	map.addControl(new OpenLayers.Control.PanZoomBarTitle({
		zoomWorldIcon: true
	}));
	map.addControl(new OpenLayers.Control.KeyboardDefaults());

	var touch = new OpenLayers.Control.TouchNavigation({
		dragPanOptions: {
			enableKinetic: true
		}
	});
	map.addControl(touch);

	map.addControl(new OpenLayers.Control.ScaleLine());
	map.addControl(new OpenLayers.Control.MagnifyingGlass());
	//map.addControl(new OpenLayers.Control.LayerSwitcher());
	// map.events.register("moveend", map, getScreenMarkers);

	initMeasureControls();

	map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
	mapOerate = new MapOperate(map);

	var level = map.getZoom();
	addMyMarkerdot(name, xx, yy);
	getpop(name, xx, yy);

}
////服务三农地图加载
function load3() {
	OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3;
	map = new OpenLayers.Map('map', {
		controls: [new OpenLayers.Control.Navigation({
			dragPanOptions: {
				enableKinetic: true
			}
		})],
		maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90)
	});
	LoadLayers();
	map.addControl(new OpenLayers.Control.PanZoomBarTitle({
		zoomWorldIcon: true
	}));
	map.addControl(new OpenLayers.Control.KeyboardDefaults());
	var touch = new OpenLayers.Control.TouchNavigation({
		dragPanOptions: {
			enableKinetic: true
		}
	});
	map.addControl(touch);
	map.addControl(new OpenLayers.Control.ScaleLine());
	map.addControl(new OpenLayers.Control.MagnifyingGlass());
	//20140922视野内搜索
	map.events.register("moveend", map, getScreenMarkers1);

	initMeasureControls();
	map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
	mapOerate = new MapOperate(map);
}

function LoadLayers() {
	var state_cva_options = options["state_cva"];
	var state_vec_options = options["state_vec"];
	if (state_vec_options != null) {
		state_vec = new OpenLayers.Layer.WMTS(state_vec_options);
		state_vec.setIsBaseLayer(true);

		state_vec.events.register("tileerror", this, loadVecError);
		map.addLayer(state_vec);
		state_vec.transitionEffect = 'resize';
	}
	if (state_cva_options != null) {
		state_cva = new OpenLayers.Layer.WMTS(state_cva_options);
		state_cva.setIsBaseLayer(false);
		state_cva.events.register("tileerror", this, loadBlankError);
		map.addLayer(state_cva);
		state_cva.transitionEffect = '';
	}


	var state_img_options = options["state_img_2013"];
	var state_cia_options = options["state_cia_2013"];
	if (state_img_options != null) {
		state_img = new OpenLayers.Layer.WMTS(state_img_options);
		state_img.setVisibility(false);
		state_img.setIsBaseLayer(true);
		state_img.events.register("tileerror", this, loadVecError);
		map.addLayer(state_img);
		state_img.transitionEffect = 'resize';
	}
	if (state_cia_options != null) {
		state_cia = new OpenLayers.Layer.WMTS(state_cia_options);
		state_cia.setIsBaseLayer(false);
		state_cia.setVisibility(false);
		state_cia.events.register("tileerror", this, loadBlankError);
		map.addLayer(state_cia);
		state_cia.transitionEffect = '';
	}


	var newmapoptionsmian = {
		name: "",
		url: "http://map.hnchj.com/newmapserver4/tianditu/henansltile/wmts",
		layer: "henansltile",
		style: "default",
		format: "image/png",
		matrixIds: matrixIds,
		zoomOffset: 1,
		matrixSet: "TileMatrixSet_0",
		buffer: 0,
		resolutions: resolutions
	};


	newmap_mian = new OpenLayers.Layer.WMTS(newmapoptionsmian);
	newmap_mian.setIsBaseLayer(false);

	newmap_mian.transitionEffect = 'resize';
	map.addLayer(newmap_mian);




	var newmapoptionsdian = {
		name: "",
		url: "http://map.hnchj.com/newmapserver4/tianditu/henansldmtile/wmts",
		layer: "henansldmtile",
		style: "default",
		format: "image/png",
		matrixIds: matrixIds,
		zoomOffset: 1,
		matrixSet: "TileMatrixSet_0",
		buffer: 0,
		resolutions: resolutions
	};


	newmap_dian = new OpenLayers.Layer.WMTS(newmapoptionsdian);
	newmap_dian.setIsBaseLayer(false);

	map.addLayer(newmap_dian);
	newmap_dian.transitionEffect = '';


	var newmapsatellitesmian = {
		name: "",
		url: "http://map.hnchj.com/newmapserver4/tianditu/henangfyxtile/wmts",
		layer: "henangfyxtile",
		style: "default",
		format: "image/png",
		matrixIds: matrixIds,
		zoomOffset: 1,
		matrixSet: "TileMatrixSet_0",
		buffer: 0,
		resolutions: resolutions
	};


	newmapsatellite_mian = new OpenLayers.Layer.WMTS(newmapsatellitesmian);
	newmapsatellite_mian.setIsBaseLayer(false);
	newmapsatellite_mian.setVisibility(false);
	map.addLayer(newmapsatellite_mian);
	newmapsatellite_mian.transitionEffect = 'resize';




	var newmapsatellitedian = {
		name: "",
		url: "http://map.hnchj.com/newmapserver4/tianditu/henangfyxdmtile/wmts",
		layer: "henangfyxdmtile",
		style: "default",
		format: "image/png",
		matrixIds: matrixIds,
		zoomOffset: 1,
		matrixSet: "TileMatrixSet_0",
		buffer: 0,
		resolutions: resolutions
	};


	newmapsatellite_dian = new OpenLayers.Layer.WMTS(newmapsatellitedian);
	newmapsatellite_dian.setIsBaseLayer(false);
	newmapsatellite_dian.setVisibility(false);

	map.addLayer(newmapsatellite_dian);
	newmapsatellite_dian.transitionEffect = '';

}


function callfn(layerid) {
	layer = map.getLayer(layerid);
	//先删除浮云
	for (var i = map.popups.length - 1; i >= 0; i--) {
		try {
			popup = map.popups[i];
			if (popup.id == layerid) {
				map.removePopup(popup);
			}
		} catch (error) {}
	}
	if (layer) {
		layer.destroyFeatures();
	}
	try {
		map.removeLayer(layer);
	} catch (error) {}
}


/////矢量影像切换
function changeMapLayer() {

	var level = map.getZoom() - 1;

	if (bVectorMap) {

		if (level > 10) {

			state_vec.setVisibility(false);
			state_cva.setVisibility(false);

		} else {
			state_vec.setVisibility(true); //天地图矢量面
			state_cva.setVisibility(true); //天地图矢量点      

		}



	} else {

		if (level >= 13) {

			state_cia.setVisibility(false);
			state_img.setVisibility(false);


		} else {
			state_img.setVisibility(true); //天地图矢量面
			state_cia.setVisibility(true); //天地图矢量点   		   

		}

	}

}

function vector1() {

	bVectorMap = true;


	map.addLayer(state_vec);
	map.addLayer(state_cva);

	state_vec.setIsBaseLayer(true);
	state_vec.setVisibility(true); //天地图矢量面
	state_cva.setVisibility(true); //天地图矢量点



	var getLayers = map.getLayersByName("state_img_2013");
	if (getLayers[0])
		map.removeLayer(state_img);

	var getLayers = map.getLayersByName("state_cia_2013");
	if (getLayers[0])
		map.removeLayer(state_cia);

	newmap_dian.setVisibility(true); //河南矢量点
	newmap_mian.setVisibility(true); //河南矢量面

	state_cia.setVisibility(false); //天地图影像点
	state_img.setVisibility(false); //天地图影像面 

	newmapsatellite_dian.setVisibility(false); //河南影像点
	newmapsatellite_mian.setVisibility(false); //河南影像面
}

function image() {
	bVectorMap = false;


	map.addLayer(state_img);
	map.addLayer(state_cia);


	var getLayers = map.getLayersByName("state_vec");
	if (getLayers[0])
		map.removeLayer(state_vec);

	var getLayers = map.getLayersByName("state_cva");
	if (getLayers[0])
		map.removeLayer(state_cva);



	state_img.setVisibility(true);
	state_cia.setVisibility(true);

	state_vec.setVisibility(false);
	state_cva.setVisibility(false);

	newmap_dian.setVisibility(false); //河南矢量点
	newmap_mian.setVisibility(false); //河南矢量面

	newmapsatellite_dian.setVisibility(true); //河南影像点
	newmapsatellite_mian.setVisibility(true); //河南影像面


}


function handleMeasurements() {


	////    var geometry = event.geometry;
	////    var units = event.units;
	////    var order = event.order;
	////    var measure = event.measure;
	////    var element = document.getElementById('output');
	////    var out = "";
	////     out += "当前距离: " + measure.toFixed(3) + " " + units; 

}

function handleMeasurements1(event) {
	var geometry = event.geometry;
	var units = event.units;
	var order = event.order;
	var measure = event.measure;
	var element = document.getElementById('output');
	var out = "";
	if (order == 1) {
		out += "当前距离: " + measure.toFixed(3) + " " + units;
	} else {
		out += "当前面积: " + measure.toFixed(3) + " " + units + "<sup>2</" + "sup>";
	}
}

function initMeasureControls() {
	var sketchSymbolizers = {
		"Point": {
			pointRadius: 4,
			fillColor: "white",
			fillOpacity: 1,
			strokeWidth: 2,
			strokeOpacity: 1,
			strokeColor: "#FF0000"
		},
		"Line": {
			strokeWidth: 2,
			strokeOpacity: 0.8,
			strokeColor: "#FD8044",
			fillOpacity: 0.1,
			strokeDashstyle: "soid"
		},
		"Polygon": {
			strokeWidth: 2,
			strokeOpacity: 1,
			strokeColor: "#FD8044",
			fillColor: "white",
			fillOpacity: 0.3
		}
	};

	var style = new OpenLayers.Style();
	style.addRules([
		new OpenLayers.Rule({
			symbolizer: sketchSymbolizers
		})
	]);
	var styleMap = new OpenLayers.StyleMap({
		"default": style
	});
	var renderer = OpenLayers.Util.getParameters(window.location.href).renderer;
	renderer = (renderer) ? [renderer] : OpenLayers.Layer.Vector.prototype.renderers;
	lineControl = new OpenLayers.Control.Measure(
		OpenLayers.Handler.Path, {
			persist: true,
			handlerOptions: {
				layerOptions: {
					renderers: renderer,
					styleMap: styleMap
				}
			}
		});
	lineControl.events.on({
		"measure": function(event) {
			var geometry = event.geometry;
			var len = geometry.components.length;
			var units = event.units;
			var order = event.order;
			var measure = event.measure;
			var point = {
				x: geometry.components[len - 1].x,
				y: geometry.components[len - 1].y
			};
			var res = this.map.getResolution();
			this.handler.layer.addFeatures([new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(point.x, point.y))]);
			var lonlat = new OpenLayers.LonLat(point.x + res * 2, point.y + res * 22);
			var out = "";
			var layer = null;
			if (units == 'km') {
				units = '公里'
			} else {
				units = '米'
			}
			out = '<div>' +
				'<label class=" BMapLabel BMap_disLabel" unselectable="on" style="float:left; display: inline; cursor: inherit; background-color: rgb(255, 255, 255); border: 1px solid rgb(255, 1, 3); padding: 3px 5px; white-space: nowrap; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: arial, simsun; z-index: 85; color: rgb(51, 51, 51); -webkit-user-select: none;">' +
				'总长：<span class="BMap_disBoxDis">' + measure.toFixed(2) + '</span>' + units + '' +
				'</label>' +
				'<div style="float:left; margin: 0px; padding: 0px; width: 12px; height: 12px; overflow: hidden;"><img style="cursor:pointer" onclick=callfn("' + this.handler.layer.id + '")' + ' src="images/close.png" class="celianClose"></div>' +
				'</div>';

			var popup = new OpenLayers.Popup.Anchored(this.handler.layer.id, lonlat, null, out, {
				size: new OpenLayers.Size(15, 10),
				offset: new OpenLayers.Pixel(0, 0)
			}, false, callfn);
			popup.calculateNewPx = function(px) {
				var newPx = px.offset(this.anchor.offset);
				newPx.y += this.anchor.size.h;
				newPx.x += this.anchor.size.w;
				return newPx;
			};
			popup.contentDiv.className = "olAnchoredPopupContent";
			popup.autoSize = true;
			popup.minSize = new OpenLayers.Size(300, 24);
			popup.opacity = "1";
			popup.backgroundColor = "#fff";
			popup.backgroundColor = null;
			this.map.addPopup(popup);
			var _lid = this.handler.layer.id;
			if (!this.lengthPopup) {
				this.lengthPopup = [];
			}
			this.lengthPopup.push(popup);
			this.handler.measureDistance = null;
			this.map.getControl("openlayer_lineControl").deactivate();
			this.map.getControlsByClass("OpenLayers.Control.Navigation")[0].activate()
			this.oldmousepop = measure.toFixed(2) + units;

		},
		"measurepartial": function(event) {
			var geometry = event.geometry;
			var len = geometry.components.length;
			var point = {
				x: geometry.components[len - 1].x,
				y: geometry.components[len - 1].y
			}
			var stat = this.getBestLength(geometry);
			var res = this.map.getResolution();
			this.handler.layer.addFeatures([new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(point.x, point.y))]);
			var lonlat = new OpenLayers.LonLat(point.x + res * 2, point.y + res * 22);
			lonlat.add(point.x, point.y);
			var unit = event.units;
			var order = event.order;
			var measure = event.measure;
			var length;
			if (unit == 'km') {
				unit = '公里'
			} else {
				unit = '米'
			}
			if (measure.toFixed(2) == "0.00") {
				length = "起点"
			} else {
				length = measure.toFixed(2) + unit;
			}
			this.newmousepop = length;

			var popstr = '<label style="border:medium none;padding:0px;background-color:#fff;display:inline;font:12px arial,simsun;wite-space:nowrap;color:#333;white-space:nowrap;">' +
				'<span style="width:5px;height:17px;position:absolute;display:block;background-image:url(\'images/dis_box_01.gif\');background-attachment:scroll;background-repeat:no-repeat;background-position-x:left;background-position-y:top;background-color:transparent;">' +

				'<span style="left:5px;color:#7a7a7a;line-height:17px;padding: 0px 4px 1px 0px;position:absolute;background:url(\'images/dis_box_01.gif\') no-repeat scroll right top transparent;">' +
				length + '</span>' +
				'</span>' +
				'</label>';
			var str = '<span style="left:5px;color:#7a7a7a;line-height:17px;padding: 0px 4px 1px 0px;position:relative;background:url(\'images/dis_box_01.gif\') no-repeat scroll right top transparent;">' +
				length + '</span>';
			var size = OpenLayers.Util.getRenderedDimensions(str, null, {});
			size.h = 17;
			size.w += 5;
			var popup = new OpenLayers.Popup.AnchoredPopup(this.handler.layer.id, lonlat, size, popstr, {
				size: new OpenLayers.Size(15, 10),
				offset: new OpenLayers.Pixel(0, 0)
			}, false, null);
			popup.calculateNewPx = function(px) {
				var newPx = px.offset(this.anchor.offset);
				newPx.y += this.anchor.size.h;
				newPx.x += this.anchor.size.w;
				return newPx;
			};
			popup.minSize = size;
			popup.opacity = "1";
			popup.backgroundColor = null;

			if (this.oldmousepop == this.newmousepop) {
				this.newmousepop = null;
				this.oldmousepop = null;
			} else {
				this.map.addPopup(popup);

			}
			if (!this.lengthPopup) {
				this.lengthPopup = [];
			}
			this.lengthPopup.push(popup);
		}
	});
	lineControl.id = "openlayer_lineControl";
	polygonControl = new OpenLayers.Control.Measure(
		OpenLayers.Handler.Polygon, {
			persist: true,
			handlerOptions: {
				layerOptions: {
					renderers: renderer,
					styleMap: styleMap
				}
			}
		}
	);
	polygonControl.events.on({
		"measure": function(event) {
			var geometry = event.geometry;
			var len = geometry.components[0].components.length;
			var units = event.units;
			var order = event.order;
			var measure = event.measure;
			var point = {
				x: geometry.components[0].components[len - 2].x,
				y: geometry.components[0].components[len - 2].y
			};
			var res = this.map.getResolution();
			var lonlat = new OpenLayers.LonLat(point.x + res * 2, point.y + res * 22);
			var out = "";
			if (units == 'km') {
				units = '平方公里'
			} else {
				units = '平方米'
			}
			out = "总面积:" + measure.toFixed(2) + units;
			this.handler.removePoint();
			out = '<div>' +
				'<label class=" BMapLabel BMap_disLabel" unselectable="on" style="float:left; display: inline; cursor: inherit; background-color: rgb(255, 255, 255); border: 1px solid rgb(255, 1, 3); padding: 3px 5px; white-space: nowrap; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: arial, simsun; z-index: 85; color: rgb(51, 51, 51); -webkit-user-select: none;">' +
				'总面积：<span class="BMap_disBoxDis">' + measure.toFixed(2) + '</span>' + units + '' +
				'</label>' +
				'<div style="float:left; margin: 0px; padding: 0px; width: 12px; height: 12px; overflow: hidden;"><img style="cursor:pointer" onclick=callfn("' + this.handler.layer.id + '")' + ' src="images/close.png" class="celianClose"></div>' +
				'</div>';
			var popup = new OpenLayers.Popup.Anchored(this.handler.layer.id, lonlat, null, out, {
				size: new OpenLayers.Size(15, 10),
				offset: new OpenLayers.Pixel(0, 0)
			}, false, callfn);
			popup.calculateNewPx = function(px) {
				var newPx = px.offset(this.anchor.offset);
				newPx.y += this.anchor.size.h;
				newPx.x += this.anchor.size.w;
				return newPx;
			};
			popup.contentDiv.className = "olAnchoredPopupContent";
			popup.autoSize = true;
			popup.minSize = new OpenLayers.Size(300, 24);
			popup.opacity = "1";
			popup.backgroundColor = "#fff";
			popup.backgroundColor = null;
			this.map.addPopup(popup);
			var _lid = this.handler.layer.id;
			if (!this.lengthPopup) {
				this.lengthPopup = [];
			}
			this.lengthPopup.push(popup);
			this.handler.measureDistance = null;
			this.map.getControl("openlayer_polygonControl").deactivate();
			this.map.getControlsByClass("OpenLayers.Control.Navigation")[0].activate();

		},
		"measurepartial": function(event) {

		}
	});
	polygonControl.id = "openlayer_polygonControl";

	measureControls = {
		line: lineControl,
		polygon: polygonControl
	};

	for (var key in measureControls) {
		var control = measureControls[key];
		control.events.on({
			"measure": function(e) {
				for (key in measureControls) {
					if (measureControls[key].active) {
						measureControls[key].deactivate();
					}
				}
			},
			"measurepartial": handleMeasurements
		});
		map.addControl(control);
	}
}

function keyEvent() {
	if (event.keyCode == 27) {
		deactivateControl();
	}
}


function deactivateControl() {
	if (measureControls && measureControls["line"]) {
		measureControls["line"].deactivate();
	}
	if (measureControls && measureControls["polygon"]) {
		measureControls["polygon"].deactivate();
	}
	if (zoomBox) {
		zoomBox.deactivate();
	}
	/////map.events.remove("click");
	getElement("map").style.cursor = "default";
	if (boxControl) {
		boxControl.box.deactivate();
	}
}

function toggleControl(value) {
	measureType = value;
	for (key in measureControls) {
		var control = measureControls[key];
		if (value == key) {

			control.activate();
		} else {
			control.deactivate();
		}
	}
}

function getElement(elementID) {
	return document.getElementById(elementID);
}


function toggleTools(num) {

	if (num == 1) {
		if (measureControls) {
			measureControls["line"].deactivate();
		}

		getElement("map").style.cursor = "crosshair";
		/// map.events.remove("click");
		if (zoomBox == null) {
			zoomBox = new OpenLayers.Control.ZoomBox();
			map.addControl(zoomBox);
			zoomBox.activate();
		} else {
			zoomBox.activate();
			zoomBox.out = false;
		}
	}
	if (num == 2) {
		if (measureControls) {
			measureControls["line"].deactivate();
		}
		getElement("map").style.cursor = "crosshair";
		///map.events.remove("click");
		if (zoomBox == null) {
			zoomBox = new OpenLayers.Control.ZoomBox();
			map.addControl(zoomBox);
			zoomBox.activate();
			zoomBox.out = true;
		} else {
			zoomBox.activate();
			zoomBox.out = true;
		}
	}
	if (num == 3) {
		if (zoomBox) {
			zoomBox.deactivate();
		}
		/// map.events.remove("click");
		getElement("map").style.cursor = "default";
		if (measureControls) {
			measureControls["line"].deactivate();
		}
	}
	if (num == 4) {
		if (zoomBox) {
			zoomBox.deactivate();
		}
		///map.events.remove("click");
		toggleControl("line");
	}
	if (num == 5) {
		if (zoomBox) {
			zoomBox.deactivate();
		}
		///map.events.remove("click");
		toggleControl("polygon");
	}
	if (num == 6) {
		document.getElementById("map").style.cursor = "crosshair";
		boxControl = new OpenLayers.Control();
		OpenLayers.Util.extend(boxControl, {
			draw: function() {
				this.box = new OpenLayers.Handler.Box(this, {
					"done": this.notice
				});
				this.box.activate();
			},
			notice: function(box) {
				var left = map.getLonLatFromPixel(new OpenLayers.Pixel(box.left, box.bottom));
				var right = map.getLonLatFromPixel(new OpenLayers.Pixel(box.right, box.top));
				var bbox = new OpenLayers.Bounds(left.lon, left.lat, right.lon, right.lat);

				var env = {
					"MinX": left.lon,
					"MinY": left.lat,
					"MaxX": right.lon,
					"MaxY": right.lat
				};
				searchMap.extSearch(env);
				this.box.deactivate();
				document.getElementById("map").style.cursor = "";
				map.removeControl(boxControl);
				boxControl = null;
			}
		});
		map.addControl(boxControl);
	}
	if (num == 7) {
		if (mark == null) {
			mark = new Mark();
		}
		getElement("map").style.cursor = "crosshair";
		map.events.register("click", map, function(e) {
			mark.markInput(map.getLonLatFromViewPortPx(e.xy));
		});
	}

}

function loadVecError(evt) {
	evt.tile.setImgSrc("openlayers/img/vec.jpg");
}


function loadBlankError(evt) {
	evt.tile.setImgSrc("openlayers/img/blank.gif");
	var image = evt.tile.getImage();
	image.style.backgroundcolor = "pink";
}


function createtempIcon(x, y) {
	var lonlat = new OpenLayers.LonLat(x, y);
	hotLayer = new OpenLayers.Layer.Markers();
	map.addLayer(hotLayer);
	var marker = common.createMarker(lonlat, "loc");
	hotLayer.addMarker(marker);
}


//20140825白
//-------------弹出信息点------------------//
function addMyMarker(n, i) {
	var json = n;

	var xyzb = json.x + "," + json.y;

	var html = "<div style=\"margin:0px;\">";

	html = html + "<p class=\"iw_poi_title\">" + json.NAME + "</p>";

	html = html + "</div>";
	html = html + "<div class=\"BMap_bubble_center\">";
	html = html + "<div style=\"width: 346px;\" class=\"BMap_bubble_content\">";
	html = html + "<div class=\"iw_poi_conTop\">";
	html = html + "<div class=\"iw_poi_content iw_poi_content_search\" >";
	html = html + " <table  cellspacing=\"0\">";
	html = html + " <tbody>";
	html = html + " <tr>";
	html = html + "<th> </th>";
	html = html + " <td style=\"height:20px\"></td>";
	html = html + " </tr>";
	html = html + " <tr>";
	html = html + "<th>所属区域：</th>";
	html = html + " <td>" + json.ssds + json.XZQ + "</td>";
	html = html + " </tr>";
	html = html + "</tbody>";
	html = html + " </table>";
	html = html + "</div>";
	html = html + " <div class=\"iw_btn_con\"></div>";
	html = html + " </div>";
	html = html + "<div id=\"ucCtrl\" class=\"ucCtrl\">";
	html = html + " <div class=\"ctrl\">";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "<div class=\"iw_poi_inter\" id=\"iw_poi_inter\">";
	html = html + " <ul class=\"nav_tab\">";
	html = html + " <li id=\"nav_tab2\" class=\"blueA hover\" onclick=\"PoPSwitch(2);\">";
	html = html + " <img src=\"image/poi/zb1.png\" align=\"absmiddle\"  style=\"height:14px;width:14px\"/> 在附近找";
	html = html + "</li>";
	html = html + " <li id=\"nav_tab0\" class=\"blueA \" onclick=\"PoPSwitch(0);\">";
	html = html + "  <img src=\"image/poi/zb2.png\" align=\"absmiddle\"  style=\"height:15px;width:10px\"/>到这里去</li>";
	html = html + " <li id=\"nav_tab1\" class=\"blueA \" onclick=\"PoPSwitch(1);\">";
	html = html + " <img src=\"image/poi/zb3.png\" align=\"absmiddle\"  style=\"height:15px;width:10px\"/>从这里出发</li>";
	html = html + " </ul>";

	html = html + " <div id=\"iw_tab0\" class=\"nav_tab_content\" style=\"display:none\">";
	html = html + " <div>";
	html = html + " <span class=\"lef\">起点</span>";
	html = html + " <span id=\"iw_ssnSpan\" class=\"iw_txt_wrap\">";
	html = html + "<input id=\"zbstart\" type=\"text\" width=\"50px\" class=\"rangekw\"/>";
	html = html + " </span>";
	html = html + " <input id=\"iw_ssb_btn\" type=\"button\" value=\"公交\" class=\"searchbtn\"  onclick=\"ZbSearch(document.getElementById('zbstart').value,'" + json.NAME + "');\">";
	html = html + " &nbsp;&nbsp;<input id=\"iw_ssd_btn\"  type=\"button\" value=\"驾车\" class=\"searchbtn\"   onclick=\"ZbZjSearch(document.getElementById('zbstart').value,'" + json.NAME + "');\"/>";
	html = html + " </div>";
	html = html + " </div>";

	html = html + " <div id=\"iw_tab1\" class=\"nav_tab_content\" style=\"display:none\">";
	html = html + " <div>";
	html = html + " <span class=\"lef\">终点</span>";
	html = html + " <span id=\"iw_esnSpan\" class=\"iw_txt_wrap\"><input id=\"zbjcstart\" type=\"text\" width=\"50px\" class=\"rangekw\"/>";
	html = html + " </span>";
	html = html + " <input id=\"iw_esb_btn\" type=\"button\" value=\"公交\" class=\"searchbtn\"  onclick=\"ZbSearch('" + json.NAME + "',document.getElementById('zbjcstart').value);\">";
	html = html + " &nbsp;&nbsp;<input id=\"iw_esd_btn\"  type=\"button\" value=\"驾车\" class=\"searchbtn\"  onclick=\"ZbZjSearch('" + json.NAME + "',document.getElementById('zbjcstart').value);\">";
	html = html + " </div>";
	html = html + " </div>";

	html = html + " <div id=\"iw_tab2\" class=\"nav_tab_content\" style=\"display:block\">";
	html = html + " <div class=\"iw_cate_list\">";
	html = html + " <a href=\"javascript:;\" onclick=\"RequestValue('银行','" + xyzb + "','" + json.NAME + "');\">银行</a>";
	html = html + " <a href=\"javascript:;\"  onclick=\"RequestValue('酒店','" + xyzb + "','" + json.NAME + "');\">酒店</a>";
	html = html + " <a href=\"javascript:;\" onclick=\"RequestValue('超市','" + xyzb + "','" + json.NAME + "');\">超市</a>";
	html = html + " </div>";
	html = html + " <div class=\"iw_cate_form\">";
	html = html + " <input tid=\"iwNSBtn\" type=\"button\" value=\"搜索\" class=\"searchbtn\"  onclick=\"RequestValue(document.getElementById('zbtxt').value,'" + xyzb + "','" + json.NAME + "');\">";
	html = html + " <input id=\"zbtxt\" type=\"text\"  class=\"rangekw1\" size=\"19\" maxlength=\"100\"  autocomplete=\"off\"/>";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "</div>";

	//mapOerate.setCenter(json.x, json.y);


	//mapOerate.map.zoomTo(13);
	mapOerate.addPopup("1", json.x, json.y, 330, 160, true, html); //true 自动关闭上一个pop;	
}

function addMyMarker1(n, xx, yy, mingzi, ssds, ssqx) {

	if (n == 1) {

		mapOerate.setCenter(xx, yy);
		mapOerate.map.zoomTo(10);
	}
	mapOerate.addIcon2(mingzi, "image/poi/red-" + n + ".png", "image/poi/b-" + n + ".png", xx, yy, 24, 30, -12, -30, ssds, ssqx, getMyMarker);

}

function addMyMarker2(n, i) {

	var json = n;
	var xyzb = json.x + "," + json.y;
	if (i == 1) {
		mapOerate.setCenter(json.x, json.y);
		mapOerate.map.zoomTo(13);
	}
	mapOerate.addIcon2(n.NAME, "image/poi/red-" + i + ".png", "image/poi/b-" + i + ".png", n.LON, n.LAT, 24, 30, -12, -30, "", "", getMyMarker);
	//alert(i + '|' + n.NAME);
}

function addMyMarkerdot(name, xx, yy) {


	mapOerate.addIcon1(name, "image/dot.png", "image/dot.png", xx, yy, 10, 10, -5, -5);

}

function getMyMarker(evt) {

	var xyzb = this.xx + "," + this.yy;

	var html = "<div style=\"margin:0px;\">";
	//    html = html + "<div style=\"opacity: 1; bottom:25px; left: -175px;\" class=\"BMap_bubble_pop\">";
	//    html = html + "<div class=\"BMap_bubble_top\">";
	html = html + "<p class=\"iw_poi_title\">" + this.name + "</p>";
	html = html + " <div class=\"BMap_bubble_buttons\">";

	html = html + "</div>";
	html = html + "</div>";
	html = html + "<div class=\"BMap_bubble_center\">";
	html = html + "<div style=\"width: 346px;\" class=\"BMap_bubble_content\">";
	html = html + "<div class=\"iw_poi_conTop\">";
	html = html + "<div class=\"iw_poi_content iw_poi_content_search\" >";
	html = html + " <table class=\"table_list_info\" cellspacing=\"0\">";
	html = html + " <tbody>";
	html = html + " <tr>";
	html = html + "<th> </th>";
	html = html + " <td style=\"height:20px\"></td>";
	html = html + " </tr>";
	html = html + " <tr>";
	html = html + "<th>所属区域：</th>";
	html = html + " <td>" + this.ssds + this.ssqx + "</td>";
	html = html + " </tr>";
	html = html + "</tbody>";
	html = html + " </table>";
	html = html + "</div>";
	html = html + " <div class=\"iw_btn_con\"></div>";
	html = html + " </div>";
	html = html + "<div id=\"ucCtrl\" class=\"ucCtrl\">";
	html = html + " <div class=\"ctrl\">";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "<div class=\"iw_poi_inter\" id=\"iw_poi_inter\">";
	html = html + " <ul class=\"nav_tab\">";
	html = html + " <li id=\"nav_tab2\" class=\"blueA hover\" onclick=\"PoPSwitch(2);\">";
	html = html + " <img src=\"image/poi/zb1.png\" align=\"absmiddle\"  style=\"height:14px;width:14px\"/> 在附近找";
	html = html + "</li>";
	html = html + " <li id=\"nav_tab0\" class=\"blueA \" onclick=\"PoPSwitch(0);\">";
	html = html + "  <img src=\"image/poi/zb2.png\" align=\"absmiddle\"  style=\"height:15px;width:10px\"/>到这里去</li>";
	html = html + " <li id=\"nav_tab1\" class=\"blueA \" onclick=\"PoPSwitch(1);\">";
	html = html + " <img src=\"image/poi/zb3.png\" align=\"absmiddle\"  style=\"height:15px;width:10px\"/>从这里出发</li>";
	html = html + " </ul>";

	html = html + " <div id=\"iw_tab0\" class=\"nav_tab_content\" style=\"display:none\">";
	html = html + " <div>";
	html = html + " <span class=\"lef\">起点</span>";
	html = html + " <span id=\"iw_ssnSpan\" class=\"iw_txt_wrap\">";
	html = html + "<input id=\"zbstart\" type=\"text\" width=\"50px\" class=\"rangekw\"/>";
	html = html + " </span>";
	html = html + " <input id=\"iw_ssb_btn\" type=\"button\" value=\"公交\" class=\"searchbtn\"  onclick=\"ZbSearch(document.getElementById('zbstart').value,'" + this.name + "');\">";
	html = html + " &nbsp;&nbsp;<input id=\"iw_ssd_btn\"  type=\"button\" value=\"驾车\" class=\"searchbtn\"   onclick=\"ZbZjSearch(document.getElementById('zbstart').value,'" + this.name + "');\"/>";
	html = html + " </div>";
	html = html + " </div>";

	html = html + " <div id=\"iw_tab1\" class=\"nav_tab_content\" style=\"display:none\">";
	html = html + " <div>";
	html = html + " <span class=\"lef\">终点</span>";
	html = html + " <span id=\"iw_esnSpan\" class=\"iw_txt_wrap\"><input id=\"zbjcstart\" type=\"text\" width=\"50px\" class=\"rangekw\"/>";
	html = html + " </span>";
	html = html + " <input id=\"iw_esb_btn\" type=\"button\" value=\"公交\" class=\"searchbtn\"  onclick=\"ZbSearch('" + this.name + "',document.getElementById('zbjcstart').value);\">";
	html = html + " &nbsp;&nbsp;<input id=\"iw_esd_btn\"  type=\"button\" value=\"驾车\" class=\"searchbtn\"  onclick=\"ZbZjSearch('" + this.name + "',document.getElementById('zbjcstart').value);\">";
	html = html + " </div>";
	html = html + " </div>";

	html = html + " <div id=\"iw_tab2\" class=\"nav_tab_content\" style=\"display:block\">";
	html = html + " <div class=\"iw_cate_list\">";
	html = html + " <a href=\"javascript:;\" onclick=\"RequestValue('银行','" + xyzb + "','" + this.name + "');\">银行</a>";
	html = html + " <a href=\"javascript:;\"  onclick=\"RequestValue('酒店','" + xyzb + "','" + this.name + "');\">酒店</a>";
	html = html + " <a href=\"javascript:;\" onclick=\"RequestValue('超市','" + xyzb + "','" + this.name + "');\">超市</a>";
	html = html + " </div>";
	html = html + " <div class=\"iw_cate_form\">";
	html = html + " <input tid=\"iwNSBtn\" type=\"button\" value=\"搜索\" class=\"searchbtn\"  onclick=\"RequestValue(document.getElementById('zbtxt').value,'" + xyzb + "','" + this.name + "');\">";
	html = html + " <input id=\"zbtxt\" type=\"text\"  class=\"rangekw1\" size=\"19\" maxlength=\"100\"  autocomplete=\"off\"/>";
	html = html + "</div>";

	html = html + "</div>";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "<div class=\"BMap_bubble_bottom\">";
	html = html + "</div>";
	//html = html + "<img style=\"left: 174px;\" src=\"Image/poi/iw_tail.png\" class=\"BMap_bubble_anchor\">";


	mapOerate.addPopup("1", this.xx, this.yy, 330, 160, true, html); //true 自动关闭上一个pop;	

}
//城市印象弹出框
function getMyMarkerCityImg(evt) {

	var xyzb = this.xx + "," + this.yy;

	var html = "<div style=\"margin:0px;\">";

	html = html + "<p>" + this.name + "</p>";

	html = html + "</div>";
	html = html + "<div class=\"BMap_bubble_center\">";
	html = html + "<div style=\"width: 346px;\" class=\"BMap_bubble_content\">";
	html = html + "<div class=\"iw_poi_conTop\">";
	html = html + "<div class=\"iw_poi_content iw_poi_content_search\" >";
	html = html + " <table class=\"table_list_info\" cellspacing=\"0\">";
	html = html + " <tbody>";
	html = html + " <tr>";
	html = html + "<th> </th>";
	html = html + " <td style=\"height:20px\"></td>";
	html = html + " </tr>";
	html = html + " <tr>";
	html = html + " <td><img src=\"" + this.url3 + "\"  width=\"260px;\" height=\"160px;\" style=\"cursor: hand;\" title=\"" + this.name + "\" onclick=\"lookimg('" + this.url3 + "')\"></td>";
	html = html + " </tr>";
	html = html + "</tbody>";
	html = html + " </table>";
	html = html + "</div>";
	html = html + " <div class=\"iw_btn_con\"></div>";
	html = html + " </div>";
	html = html + "<div id=\"ucCtrl\" class=\"ucCtrl\">";
	html = html + " <div class=\"ctrl\">";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "<div class=\"iw_poi_inter\" id=\"iw_poi_inter\">";
	html = html + " <ul class=\"nav_tab\">";
	html = html + " <li id=\"nav_tab2\" class=\"blueA hover\" onclick=\"PoPSwitch(2);\">";
	html = html + " <img src=\"image/poi/zb1.png\" align=\"absmiddle\"  style=\"height:14px;width:14px\"/> 在附近找";
	html = html + "</li>";
	html = html + " <li id=\"nav_tab0\" class=\"blueA \" onclick=\"PoPSwitch(0);\">";
	html = html + "  <img src=\"image/poi/zb2.png\" align=\"absmiddle\"  style=\"height:15px;width:10px\"/>到这里去</li>";
	html = html + " <li id=\"nav_tab1\" class=\"blueA \" onclick=\"PoPSwitch(1);\">";
	html = html + " <img src=\"image/poi/zb3.png\" align=\"absmiddle\"  style=\"height:15px;width:10px\"/>从这里出发</li>";
	html = html + " </ul>";

	html = html + " <div id=\"iw_tab0\" class=\"nav_tab_content\" style=\"display:none\">";
	html = html + " <div>";
	html = html + " <span class=\"lef\">起点</span>";
	html = html + " <span id=\"iw_ssnSpan\" class=\"iw_txt_wrap\">";
	html = html + "<input id=\"zbstart\" type=\"text\" width=\"50px\" class=\"rangekw\"/>";
	html = html + " </span>";
	html = html + " <input id=\"iw_ssb_btn\" type=\"button\" value=\"公交\" class=\"searchbtn\"  onclick=\"ZbSearch(document.getElementById('zbstart').value,'" + this.name + "');\">";
	html = html + " &nbsp;&nbsp;<input id=\"iw_ssd_btn\"  type=\"button\" value=\"驾车\" class=\"searchbtn\"   onclick=\"ZbZjSearch(document.getElementById('zbstart').value,'" + this.name + "');\"/>";
	html = html + " </div>";
	html = html + " </div>";

	html = html + " <div id=\"iw_tab1\" class=\"nav_tab_content\" style=\"display:none\">";
	html = html + " <div>";
	html = html + " <span class=\"lef\">终点</span>";
	html = html + " <span id=\"iw_esnSpan\" class=\"iw_txt_wrap\"><input id=\"zbjcstart\" type=\"text\" width=\"50px\" class=\"rangekw\"/>";
	html = html + " </span>";
	html = html + " <input id=\"iw_esb_btn\" type=\"button\" value=\"公交\" class=\"searchbtn\"  onclick=\"ZbSearch('" + this.name + "',document.getElementById('zbjcstart').value);\">";
	html = html + " &nbsp;&nbsp;<input id=\"iw_esd_btn\"  type=\"button\" value=\"驾车\" class=\"searchbtn\"  onclick=\"ZbZjSearch('" + this.name + "',document.getElementById('zbjcstart').value);\">";
	html = html + " </div>";
	html = html + " </div>";

	html = html + " <div id=\"iw_tab2\" class=\"nav_tab_content\" style=\"display:block\">";
	html = html + " <div class=\"iw_cate_list\">";
	html = html + " <a href=\"javascript:;\" onclick=\"RequestValue('银行','" + xyzb + "','" + this.name + "');\">银行</a>";
	html = html + " <a href=\"javascript:;\"  onclick=\"RequestValue('酒店','" + xyzb + "','" + this.name + "');\">酒店</a>";
	html = html + " <a href=\"javascript:;\" onclick=\"RequestValue('超市','" + xyzb + "','" + this.name + "');\">超市</a>";
	html = html + " </div>";
	html = html + " <div class=\"iw_cate_form\">";
	html = html + " <input tid=\"iwNSBtn\" type=\"button\" value=\"搜索\" class=\"searchbtn\"  onclick=\"RequestValue(document.getElementById('zbtxt').value,'" + xyzb + "','" + this.name + "');\">";
	html = html + " <input id=\"zbtxt\" type=\"text\"  class=\"rangekw1\" size=\"19\" maxlength=\"100\"  autocomplete=\"off\"/>";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "</div>";

	mapOerate.addPopup("1", this.xx, this.yy, 330, 160, true, html); //true 自动关闭上一个pop;	

}
//寻根问祖弹出框
function getMyMarkerXunGen(evt) {

	var xyzb = this.xx + "," + this.yy;

	var html = "<div style=\"margin:0px;\">";

	html = html + "<p class=\"iw_poi_title\">" + this.name + "姓</p>";

	html = html + "</div>";
	html = html + "<div class=\"BMap_bubble_center\">";
	html = html + "<div style=\"width: 346px;\" class=\"BMap_bubble_content\">";
	html = html + "<div class=\"iw_poi_conTop\">";
	html = html + "<div class=\"iw_poi_content iw_poi_content_search\" >";
	html = html + " <table class=\"table_list_info\" cellspacing=\"0\">";
	html = html + " <tbody>";

	html = html + " <tr>";

	html = html + " <td class=\"xungen\"><div>&nbsp;&nbsp;&nbsp;" + this.url3 + "</div></td>";
	html = html + " </tr>";
	html = html + "</tbody>";
	html = html + " </table>";
	html = html + "</div>";
	html = html + " <div class=\"iw_btn_con\"></div>";
	html = html + " </div>";
	html = html + "<div id=\"ucCtrl\" class=\"ucCtrl\">";
	html = html + " <div class=\"ctrl\">";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "<div class=\"iw_poi_inter\" id=\"iw_poi_inter\">";
	html = html + " <ul class=\"nav_tab\">";
	html = html + " <li id=\"nav_tab2\" class=\"blueA hover\" onclick=\"PoPSwitch(2);\">";
	html = html + " <img src=\"image/poi/zb1.png\" align=\"absmiddle\"  style=\"height:14px;width:14px\"/> 在附近找";
	html = html + "</li>";
	html = html + " <li id=\"nav_tab0\" class=\"blueA \" onclick=\"PoPSwitch(0);\">";
	html = html + "  <img src=\"image/poi/zb2.png\" align=\"absmiddle\"  style=\"height:15px;width:10px\"/>到这里去</li>";
	html = html + " <li id=\"nav_tab1\" class=\"blueA \" onclick=\"PoPSwitch(1);\">";
	html = html + " <img src=\"image/poi/zb3.png\" align=\"absmiddle\"  style=\"height:15px;width:10px\"/>从这里出发</li>";
	html = html + " </ul>";

	html = html + " <div id=\"iw_tab0\" class=\"nav_tab_content\" style=\"display:none\">";
	html = html + " <div>";
	html = html + " <span class=\"lef\">起点</span>";
	html = html + " <span id=\"iw_ssnSpan\" class=\"iw_txt_wrap\">";
	html = html + "<input id=\"zbstart\" type=\"text\" width=\"50px\" class=\"rangekw\"/>";
	html = html + " </span>";
	html = html + " <input id=\"iw_ssb_btn\" type=\"button\" value=\"公交\" class=\"searchbtn\"  onclick=\"ZbSearch(document.getElementById('zbstart').value,'" + this.name + "');\">";
	html = html + " &nbsp;&nbsp;<input id=\"iw_ssd_btn\"  type=\"button\" value=\"驾车\" class=\"searchbtn\"   onclick=\"ZbZjSearch(document.getElementById('zbstart').value,'" + this.name + "');\"/>";
	html = html + " </div>";
	html = html + " </div>";

	html = html + " <div id=\"iw_tab1\" class=\"nav_tab_content\" style=\"display:none\">";
	html = html + " <div>";
	html = html + " <span class=\"lef\">终点</span>";
	html = html + " <span id=\"iw_esnSpan\" class=\"iw_txt_wrap\"><input id=\"zbjcstart\" type=\"text\" width=\"50px\" class=\"rangekw\"/>";
	html = html + " </span>";
	html = html + " <input id=\"iw_esb_btn\" type=\"button\" value=\"公交\" class=\"searchbtn\"  onclick=\"ZbSearch('" + this.name + "',document.getElementById('zbjcstart').value);\">";
	html = html + " &nbsp;&nbsp;<input id=\"iw_esd_btn\"  type=\"button\" value=\"驾车\" class=\"searchbtn\"  onclick=\"ZbZjSearch('" + this.name + "',document.getElementById('zbjcstart').value);\">";
	html = html + " </div>";
	html = html + " </div>";

	html = html + " <div id=\"iw_tab2\" class=\"nav_tab_content\" style=\"display:block\">";
	html = html + " <div class=\"iw_cate_list\">";
	html = html + " <a href=\"javascript:;\" onclick=\"RequestValue('银行','" + xyzb + "','" + this.name + "');\">银行</a>";
	html = html + " <a href=\"javascript:;\"  onclick=\"RequestValue('酒店','" + xyzb + "','" + this.name + "');\">酒店</a>";
	html = html + " <a href=\"javascript:;\" onclick=\"RequestValue('超市','" + xyzb + "','" + this.name + "');\">超市</a>";
	html = html + " </div>";
	html = html + " <div class=\"iw_cate_form\">";
	html = html + " <input tid=\"iwNSBtn\" type=\"button\" value=\"搜索\" class=\"searchbtn\"  onclick=\"RequestValue(document.getElementById('zbtxt').value,'" + xyzb + "','" + this.name + "');\">";
	html = html + " <input id=\"zbtxt\" type=\"text\"  class=\"rangekw1\" size=\"19\" maxlength=\"100\"  autocomplete=\"off\"/>";
	html = html + "</div>";

	html = html + "</div>";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "</div>";



	mapOerate.addPopup("1", this.xx, this.yy, 330, 160, true, html); //true 自动关闭上一个pop;	

}
/////天气预报弹出框
function getMyMarkertianqi(evt) {

	var xyzb = this.xx + "," + this.yy;

	var html = "<div style=\"margin:0px;\">";
	html = html + "<p class=\"iw_poi_title\">" + this.name + "</p>";
	html = html + "</div>";
	html = html + " <table class=\"table_list_info\" cellspacing=\"0\">";
	html = html + " <tbody>";
	html = html + " <tr>";
	html = html + "<th> </th>";
	html = html + " <td style=\"height:20px\"></td>";
	html = html + " </tr>";
	html = html + " <tr>";
	html = html + " <td class=\"xungen\"><div> <iframe name=\"weather_inc\" src=\"" + this.url3 + "\"  width=\"225\" height=\"80\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"></iframe></div></td>";
	html = html + " </tr>";
	html = html + "</tbody>";
	html = html + " </table>";
	mapOerate.addPopup("1", this.xx, this.yy, 280, 160, true, html); //true 自动关闭上一个pop;	

}

//红色地图弹出框
function getMyMarkerHongSe(evt) {
	var xyzb = this.xx + "," + this.yy;
	var html = "<div style=\"margin:0px;\">";


	html = html + "<p class=\"iw_poi_title\">" + this.name + "</p>";

	html = html + " <div class=\"BMap_bubble_buttons\">";

	html = html + "</div>";
	html = html + "</div>";
	html = html + "<div class=\"BMap_bubble_center\">";
	html = html + "<div style=\"width: 346px;\" class=\"BMap_bubble_content\">";
	html = html + "<div class=\"iw_poi_conTop\">";
	html = html + "<div class=\"iw_poi_content iw_poi_content_search\" >";
	html = html + " <table class=\"table_list_info\" cellspacing=\"0\">";
	html = html + " <tbody>";

	html = html + " <tr>";

	html = html + " <td class=\"xungen\"><div>" + this.url3 + "</div></td>";
	html = html + " </tr>";
	html = html + "</tbody>";
	html = html + " </table>";
	html = html + "</div>";
	html = html + " <div class=\"iw_btn_con\"></div>";
	html = html + " </div>";
	html = html + "<div id=\"ucCtrl\" class=\"ucCtrl\">";
	html = html + " <div class=\"ctrl\">";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "<div class=\"iw_poi_inter\" id=\"iw_poi_inter\">";
	html = html + " <ul class=\"nav_tab\">";
	html = html + " <li id=\"nav_tab2\" class=\"blueA hover\" onclick=\"PoPSwitch(2);\">";
	html = html + " <img src=\"image/poi/zb1.png\" align=\"absmiddle\"  style=\"height:14px;width:14px\"/> 在附近找";
	html = html + "</li>";
	html = html + " <li id=\"nav_tab0\" class=\"blueA \" onclick=\"PoPSwitch(0);\">";
	html = html + "  <img src=\"image/poi/zb2.png\" align=\"absmiddle\"  style=\"height:15px;width:10px\"/>到这里去</li>";
	html = html + " <li id=\"nav_tab1\" class=\"blueA \" onclick=\"PoPSwitch(1);\">";
	html = html + " <img src=\"image/poi/zb3.png\" align=\"absmiddle\"  style=\"height:15px;width:10px\"/>从这里出发</li>";
	html = html + " </ul>";

	html = html + " <div id=\"iw_tab0\" class=\"nav_tab_content\" style=\"display:none\">";
	html = html + " <div>";
	html = html + " <span class=\"lef\">起点</span>";
	html = html + " <span id=\"iw_ssnSpan\" class=\"iw_txt_wrap\">";
	html = html + "<input id=\"zbstart\" type=\"text\" width=\"50px\" class=\"rangekw\"/>";
	html = html + " </span>";
	html = html + " <input id=\"iw_ssb_btn\" type=\"button\" value=\"公交\" class=\"searchbtn\"  onclick=\"ZbSearch(document.getElementById('zbstart').value,'" + this.name + "');\">";
	html = html + " &nbsp;&nbsp;<input id=\"iw_ssd_btn\"  type=\"button\" value=\"驾车\" class=\"searchbtn\"   onclick=\"ZbZjSearch(document.getElementById('zbstart').value,'" + this.name + "');\"/>";
	html = html + " </div>";
	html = html + " </div>";

	html = html + " <div id=\"iw_tab1\" class=\"nav_tab_content\" style=\"display:none\">";
	html = html + " <div>";
	html = html + " <span class=\"lef\">终点</span>";
	html = html + " <span id=\"iw_esnSpan\" class=\"iw_txt_wrap\"><input id=\"zbjcstart\" type=\"text\" width=\"50px\" class=\"rangekw\"/>";
	html = html + " </span>";
	html = html + " <input id=\"iw_esb_btn\" type=\"button\" value=\"公交\" class=\"searchbtn\"  onclick=\"ZbSearch('" + this.name + "',document.getElementById('zbjcstart').value);\">";
	html = html + " &nbsp;&nbsp;<input id=\"iw_esd_btn\"  type=\"button\" value=\"驾车\" class=\"searchbtn\"  onclick=\"ZbZjSearch('" + this.name + "',document.getElementById('zbjcstart').value);\">";
	html = html + " </div>";
	html = html + " </div>";

	html = html + " <div id=\"iw_tab2\" class=\"nav_tab_content\" style=\"display:block\">";
	html = html + " <div class=\"iw_cate_list\">";
	html = html + " <a href=\"javascript:;\" onclick=\"RequestValue('银行','" + xyzb + "','" + this.name + "');\">银行</a>";
	html = html + " <a href=\"javascript:;\"  onclick=\"RequestValue('酒店','" + xyzb + "','" + this.name + "');\">酒店</a>";
	html = html + " <a href=\"javascript:;\" onclick=\"RequestValue('超市','" + xyzb + "','" + this.name + "');\">超市</a>";
	html = html + " </div>";
	html = html + " <div class=\"iw_cate_form\">";
	html = html + " <input tid=\"iwNSBtn\" type=\"button\" value=\"搜索\" class=\"searchbtn\"  onclick=\"RequestValue(document.getElementById('zbtxt').value,'" + xyzb + "','" + this.name + "');\">";
	html = html + " <input id=\"zbtxt\" type=\"text\"  class=\"rangekw1\" size=\"19\" maxlength=\"100\"  autocomplete=\"off\"/>";
	html = html + "</div>";

	html = html + "</div>";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "</div>";

	mapOerate.addPopup("1", this.xx, this.yy, 330, 160, true, html); //true 自动关闭上一个pop;	

}

function delMyMarker() {
	mapOerate.delIcon1();
	mapOerate.delIcon2();
	mapOerate.delIcon4();
	mapOerate.delIcon5();



}
//20140901白
//放大
function zoomin() {
	mapOerate.mouseMoveZoomIn();
}
//缩小
function zoomout() {
	mapOerate.mouseMoveZoomOut();
}
//移动
function setmove() {
	mapOerate.setMove();
}
//测距
function ceju() {
	toggleTools(4);
}
//测面
function cemian() {
	toggleTools(5);
}
//清除
function clearmap() {

	mapOerate.delMarker();
	mapOerate.delIcon1();
	mapOerate.delIcon2();
	mapOerate.delIcon3();
	mapOerate.delIcon4();
	mapOerate.delIcon5();
	mapOerate.delPopup();
	mapOerate.delLine();
	mapOerate.delPolygon();
	if (tucenglayer) {
		map.removeLayer(tucenglayer);

		for (var i = 1; i < 5; i++) {

			document.getElementById("CheckBox" + i).checked = false;
		}
	}

	for (var i = 0; i < map.getNumLayers(); i++) {
		var layer = map.layers[i];
		if (!layer.isBaseLayer) {

			if (layer.CLASS_NAME != "OpenLayers.Layer.WMTS" && layer.CLASS_NAME != "OpenLayers.Layer.Markers") {
				map.removeLayer(layer);
			}
		}

	}

}

function GetXY() {
	//alert(mapOerate.outputLonLat.map.mouseDownLonlat.lon);
	mapOerate.outputLonLat();
	//mapOerate.addIcon1("起点", "image/poi/icon_qi.png", "image/poi/icon_qi.png", "", "", 42, 33, 0, 0, outputLonLat);
	//var lonlat = map.getLonLatFromViewPortPx(new OpenLayers.Pixel(pos.x, pos.y));
	//    mapOerate.outputLonLat();
	//    alert(this.mouseDownLonlat.lon);
}
//-------------公交，自驾 起点终点标示------------------------//
function QiDian(xy) {

	if (xy != "") {
		var mkerOptions = {
			imgUrl: "image/qidian.png",
			markerSize: new NXY(42, 33),
			imgOffset: new NXY(0, 0),
			markerAnchor: new NXY(42, 33),
			markerTitle: "起点",
			draggable: false,
			openDialog: true
		};

		var ss = xy.split(',');
		marker = new NSpriteMarker(new NXY(ss[0], ss[1]), mkerOptions);
		mapOerate.setCenter(ss[0], ss[1]);
		mapOerate.map.zoomTo(10);
		mapOerate.addIcon1("起点", "image/qidian.png", "image/qidian.png", ss[0], ss[1], 42, 33, -12, -12, "");
		//        m.addOverlays(marker);
		//        m.moveTo(new NXY(ss[0], ss[1]));
		//        var pointList = [];
		//        var strl = xy.split(",");
		//        var point1 = new OpenLayers.Geometry.Point(strl[0], strl[1]);
		//        pointList.push(point1);
		//        mapOerate.addIcon1(pointList, mkerOptions);
	}
}

//矢量
function vector() {

	map.setMapType(TMAP_NORMAL_MAP);
}

function ZhongDian(xy) {

	if (xy != "") {
		var mkerOptions = {
			imgUrl: "image/zhongdian.png",
			markerSize: new NXY(42, 33),
			imgOffset: new NXY(0, 0),
			markerAnchor: new NXY(12, 15),
			markerTitle: "终点",
			draggable: false,
			openDialog: true
		};
		var ss = xy.split(',');
		marker = new NSpriteMarker(new NXY(ss[0], ss[1]), mkerOptions);
		//        m.addOverlays(marker);
		//        m.moveTo(new NXY(ss[0], ss[1]));
		mapOerate.setCenter(ss[0], ss[1]);
		mapOerate.map.zoomTo(10);
		mapOerate.addIcon1("终点", "image/zhongdian.png", "image/zhongdian.png", ss[0], ss[1], 42, 33, -15, -15, "");
	}
}

function drawbusstationpoi(xy, name) {
	if (xy != "") {
		var mkerOptions = {
			imgUrl: "image/ico/zhandian_B.png",
			markerSize: new NXY(12, 12),
			imgOffset: new NXY(0, 0),
			markerAnchor: new NXY(12, 12),
			markerTitle: name,
			draggable: false,
			openDialog: true
		};
		var ss = xy.split(',');
		marker = new NSpriteMarker(new NXY(ss[0], ss[1]), mkerOptions);
		//        m.addOverlays(marker);
		//        m.moveTo(new NXY(ss[0], ss[1]), 13);
		mapOerate.setCenter(ss[0], ss[1]);
		mapOerate.map.zoomTo(13);
		mapOerate.addIcon1(name, "image/ico/zhandian_B.png", "image/ico/zhandian_B.png", ss[0], ss[1], 12, 12, 12, 12, "");
	}
}
//画线
function RoadLine(lins) {
	var strlist = lins.split(";");
	style_green = {
		strokeColor: "#0000FF",
		strokeOpacity: 0.8,
		strokeWidth: 3,
		pointRadius: 2,
		strokeDashstyle: "solid", //'dot': 'dash': 'dashdot':'longdash':ongdashdot':

		pointerEvents: "visiblePainted"
	};
	var pointList = [];
	for (var i = 0; i < strlist.length - 1; i++) {

		var strl = strlist[i].split(",");
		var point1 = new OpenLayers.Geometry.Point(strl[0], strl[1]);
		pointList.push(point1);

	}
	mapOerate.addLine(pointList, style_green);

}
//画圆
function drawcircle(xx, yy, bj) {
	if (bj == "" || bj == null) {
		bj = 1000;
	}
	mapOerate.addCircle(xx, yy, bj);
	mapOerate.setCenter(xx, yy);
	mapOerate.map.zoomTo(13);
	//    var xy8 = new NXY(xx, yy);
	//    C = new NCircle(xy8, bj);
	//    m.addOverlays(C);
	//    m.moveTo(new NXY(xx, yy), 15);
}
//白
function changeColor(id) {

}

function getMyPosition1(e) {
	mapOerate.removeOverlays([L, mkerOpstart]);
	var mkerOp = {
		imgUrl: "image/qidian.png",
		markerSize: new NXY(42, 33),
		imgOffset: new NXY(10, 14),
		markerAnchor: new NXY(12, 15),
		draggable: true
	};
	$("#linestart").val(e["point"].x + "," + e["point"].y);
	//NSpriteMarker类实例化   
	mkerOpstart = new NMarker(new NXY(e["point"].x, e["point"].y), mkerOp);

	//标注添加到地图  
	mkerOpstart.on("dragend", marDragend);

	mapOerate.addOverlays(mkerOpstart);
	if ($("#lineend").val() != "") {
		if (document.getElementById("content2").style.display == "") {
			MapTab(2);
			CarDataBus("所选起点", "所选终点");
		} else if (document.getElementById("content3").style.display == "") {
			MapTab(3);
			CarData("所选起点", "所选终点");
		} else if (document.getElementById("content1").style.display == "") {
			alert("1");
			MapTab(2);
			CarDataBus("所选起点", "所选终点");
		}
	}
}

function getMyPosition2(e) {
	mapOerate.removeOverlays([L, mkerOpend]);
	var mkerOp = {
		imgUrl: "image/zhongdian.png",
		markerSize: new NXY(42, 33),
		imgOffset: new NXY(10, 14),
		markerAnchor: new NXY(12, 15),
		draggable: true
	};
	//NSpriteMarker类实例化   
	$("#lineend").val(e["point"].x + "," + e["point"].y)
	mkerOpend = new NMarker(new NXY(e["point"].x, e["point"].y), mkerOp);
	//标注添加到地图  
	mkerOpend.on("dragend", marDragend);

	mapOerate.addOverlays(mkerOpend);

	if ($("#linestart").val() != "") {
		if (document.getElementById("content2").style.display == "") {
			MapTab(2);
			CarDataBus("所选起点", "所选终点");
		} else if (document.getElementById("content3").style.display == "") {
			MapTab(3);
			CarData("所选起点", "所选终点");
		} else if (document.getElementById("content1").style.display == "") {
			MapTab(2);
			CarDataBus("所选起点", "所选终点");
		}
	}
}
//城市印象201409
function CityYX(n, x, y, purl) {
	//mapOerate.setCenter(x, y);
	//mapOerate.map.zoomTo(6);
	//alert(purl);
	mapOerate.addIcon3(n, "image/poi/city_image_ico.png", "image/poi/city_image_ico.png", x, y, 10, 10, 0, 0, purl, getMyMarkerCityImg);
}

//打开城市印象图片
function lookimg(str) {
	window.open(str, 'newwindow');
}
//寻根问祖201409
function CityXGWZ(n, x, y, jianjie) {
	//mapOerate.setCenter(x, y);
	//mapOerate.map.zoomTo(6);
	mapOerate.addIcon3(n, "image/baijia/" + n + ".png", "image/baijia/" + n + ".png", x, y, 18, 18, 0, 0, jianjie, getMyMarkerXunGen);
}
//红色地图201409
function CityHS(n, x, y, jianjie) {
	//mapOerate.setCenter(x, y);
	//mapOerate.map.zoomTo(6);
	mapOerate.addIcon3(n, "image/poi/hongse.png", "image/poi/hongse.png", x, y, 16, 15, 0, 0, jianjie, getMyMarkerHongSe);
}
///天气预报
function QianqiYX(n, x, y, purl) {
	// mapOerate.setCenter(x, y);
	// mapOerate.map.zoomTo(6);
	mapOerate.addIcon3(n, "image/poi/tianqi.png", "image/poi/tianqi.png", x, y, 42, 42, 0, 0, purl, getMyMarkertianqi);

}
//关闭信息框
function CloseXinXi() {
	mapOerate.delPopup();
	mapOerate.dleTempLine();
	mapOerate.dleTempPolygon();

}

function getpop(name, jd, wd) {

	var measure = name;
	id = "456";

	out = '<div>' +
		'<label class=" BMapLabel BMap_disLabel" unselectable="on" style="float:left; display: inline; cursor: inherit; background-color: rgb(255, 255, 255); border: 1px solid rgb(255, 1, 3); padding: 3px 5px; white-space: nowrap; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: arial, simsun; z-index: 85; color: rgb(51, 51, 51); -webkit-user-select: none;">' +
		'<span class="BMap_disBoxDis">' + measure + '</span>' +
		'</label>' +
		'<div style="float:left; margin: 0px; padding: 0px; width: 12px; height: 12px; overflow: hidden;"><img style="cursor:pointer" onclick=callfn("' + id + '")' + ' src="images/close.png" class="celianClose"></div>' +
		'</div>';

	var midpoint = new OpenLayers.LonLat(jd, wd);
	var popup = new OpenLayers.Popup.Anchored(id, midpoint, null, out, {
		size: new OpenLayers.Size(15, 10),
		offset: new OpenLayers.Pixel(0, -20)
	}, false);
	popup.contentDiv.className = "olAnchoredPopupContent";
	popup.autoSize = true;
	popup.minSize = new OpenLayers.Size(300, 24);
	popup.opacity = "1";
	popup.backgroundColor = "#fff";
	popup.backgroundColor = null;
	map.addPopup(popup);

}

function biaodian() {
	delMyMarker();
	mapOerate.setReturnClick(getClick);
}
var mbzname = "";
var mbzbeizhu = "";

function getClick(x, y) {

	marker = mapOerate.addIcon5("标注点", "OpenLayers/img/marker.png", "OpenLayers/img/marker.png", x, y, 21, 25, -10, -25, getMoveMarker);
	mapOerate.setMove(); //设置成移动状态
	var html = "<div style=\"margin:0px;\">";

	html = html + "<p class=\"iw_poi_title\">标注点</p>";
	html = html + "</div>";
	html = html + " <table class=\"table_list_info\" cellspacing=\"0\">";
	html = html + " <tbody>";
	html = html + " <tr>";
	html = html + "<th> </th>";
	html = html + " <td style=\"height:20px\"></td>";
	html = html + " </tr>";
	html = html + " <tr>";
	html = html + " <tr><th>名称：</th>";
	html = html + "<td><input id=\"wtper\" type=\"text\"  class=\"biaozhutxt\"/></td>";
	html = html + " </tr>";
	html = html + " <tr>";
	html = html + "<th> </th>";
	html = html + " <td style=\"height:2px\"></td>";
	html = html + " </tr>";
	html = html + " <tr>";
	html = html + "<th> </th>";
	html = html + " <td style=\"height:2px\"></td>";
	html = html + " </tr>";
	html = html + " <tr><th>备注：</th>";
	html = html + "<td><textarea id=\"wtmemo\" class=\"biaozhutxt\" style=\"height:60px\"></textarea></td>";
	html = html + " </tr>";

	html = html + " <tr>";
	html = html + "<th> </th>";
	html = html + " <td style=\"height:3px\"></td>";
	html = html + " </tr>";
	html = html + " <tr><th></th>";
	html = html + "<td><input id=\"subtn\" type=\"button\"  class=\"biaozhubtn\" onclick=\"biaozusumit(" + marker.lonlat.lon + "," + marker.lonlat.lat + ");\"/>   <input id=\"subtn\" type=\"button\"  class=\"biaozhubtn1\" onclick=\"delbz();\"/></td>";
	html = html + " </tr>";
	html = html + "</tbody>";
	html = html + " </table>";


	mapOerate.addPopup("1", marker.lonlat.lon, marker.lonlat.lat, 330, 160, true, html); //true 自动关闭上一个pop;	
}

function biaozusumit(xx, yy) {
	mbzname = $("#wtper").val();
	mbzbeizhu = $("#wtmemo").val();
	CloseXinXi();
}

function delbz() {

	mapOerate.delPopup();

}

function getMoveMarker(evt, marker) {

	var xyzb = marker.lonlat.lon + "," + marker.lonlat.lat;
	var html = "<div style=\"margin:0px;\">";
	html = html + "<p>" + mbzname + "</p>";

	html = html + "<img class='shouc' src=\"Image/poi/save.png\" style=\"cursor:hand;\" title=\"收藏\" onclick='savebz( marker.lonlat.lon,marker.lonlat.lat);'>";
	html = html + "<img class='shouc' src=\"Image/poi/del.png\" style=\"cursor:hand;\" title=\"删除\" onclick='delbz();'>";

	html = html + "</div>";

	html = html + " <table class=\"table_list_info\" cellspacing=\"0\">";
	html = html + " <tbody>";
	html = html + " <tr>";
	html = html + "<th> </th>";
	html = html + " <td style=\"height:20px\"></td>";
	html = html + " </tr>";
	html = html + " <tr>";
	html = html + " <tr>";
	html = html + "<th> </th>";
	html = html + " <td style=\"height:2px\"></td>";
	html = html + " </tr>";
	html = html + " <tr>";
	html = html + "<th> </th>";
	html = html + " <td style=\"height:2px\"></td>";
	html = html + " </tr>";
	html = html + " <tr>";
	html = html + "<td>" + mbzbeizhu + "</td>";
	html = html + " </tr>";

	html = html + " <tr>";
	html = html + "<th> </th>";
	html = html + " <td style=\"height:3px\"></td>";
	html = html + " </tr>";
	html = html + "</tbody>";
	html = html + " </table>";
	html = html + "</div>";
	html = html + " <div class=\"iw_btn_con\"></div>";
	html = html + " </div>";
	html = html + "<div id=\"ucCtrl\" class=\"ucCtrl\">";
	html = html + " <div class=\"ctrl\">";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "<div class=\"iw_poi_inter\" id=\"iw_poi_inter\">";
	html = html + " <ul class=\"nav_tab\">";
	html = html + " <li id=\"nav_tab2\" class=\"blueA hover\" onclick=\"PoPSwitch(2);\">";
	html = html + " <img src=\"image/poi/zb1.png\" align=\"absmiddle\"  style=\"height:14px;width:14px\"/> 在附近找";
	html = html + "</li>";
	html = html + " <li id=\"nav_tab0\" class=\"blueA \" onclick=\"PoPSwitch(0);\">";
	html = html + "  <img src=\"image/poi/zb2.png\" align=\"absmiddle\"  style=\"height:15px;width:10px\"/>到这里去</li>";
	html = html + " <li id=\"nav_tab1\" class=\"blueA \" onclick=\"PoPSwitch(1);\">";
	html = html + " <img src=\"image/poi/zb3.png\" align=\"absmiddle\"  style=\"height:15px;width:10px\"/>从这里出发</li>";
	html = html + " </ul>";

	html = html + " <div id=\"iw_tab0\" class=\"nav_tab_content\" style=\"display:none\">";
	html = html + " <div>";
	html = html + " <span class=\"lef\">起点</span>";
	html = html + " <span id=\"iw_ssnSpan\" class=\"iw_txt_wrap\">";
	html = html + "<input id=\"zbstart\" type=\"text\" width=\"50px\" class=\"rangekw\"/>";
	html = html + " </span>";
	html = html + " <input id=\"iw_ssb_btn\" type=\"button\" value=\"公交\" class=\"searchbtn\"  onclick=\"ZbSearch(document.getElementById('zbstart').value,'" + mbzname + "');\">";
	html = html + " &nbsp;&nbsp;<input id=\"iw_ssd_btn\"  type=\"button\" value=\"驾车\" class=\"searchbtn\"   onclick=\"ZbZjSearch(document.getElementById('zbstart').value,'" + mbzname + "');\"/>";
	html = html + " </div>";
	html = html + " </div>";

	html = html + " <div id=\"iw_tab1\" class=\"nav_tab_content\" style=\"display:none\">";
	html = html + " <div>";
	html = html + " <span class=\"lef\">终点</span>";
	html = html + " <span id=\"iw_esnSpan\" class=\"iw_txt_wrap\"><input id=\"zbjcstart\" type=\"text\" width=\"50px\" class=\"rangekw\"/>";
	html = html + " </span>";
	html = html + " <input id=\"iw_esb_btn\" type=\"button\" value=\"公交\" class=\"searchbtn\"  onclick=\"ZbSearch('" + mbzname + "',document.getElementById('zbjcstart').value);\">";
	html = html + " &nbsp;&nbsp;<input id=\"iw_esd_btn\"  type=\"button\" value=\"驾车\" class=\"searchbtn\"  onclick=\"ZbZjSearch('" + mbzname + "',document.getElementById('zbjcstart').value);\">";
	html = html + " </div>";
	html = html + " </div>";

	html = html + " <div id=\"iw_tab2\" class=\"nav_tab_content\" style=\"display:block\">";
	html = html + " <div class=\"iw_cate_list\">";
	html = html + " <a href=\"javascript:;\" onclick=\"RequestValue('银行','" + xyzb + "','" + mbzname + "');\">银行</a>";
	html = html + " <a href=\"javascript:;\"  onclick=\"RequestValue('酒店','" + xyzb + "','" + mbzname + "');\">酒店</a>";
	html = html + " <a href=\"javascript:;\" onclick=\"RequestValue('超市','" + xyzb + "','" + mbzname + "');\">超市</a>";
	html = html + " </div>";
	html = html + " <div class=\"iw_cate_form\">";
	html = html + " <input tid=\"iwNSBtn\" type=\"button\" value=\"搜索\" class=\"searchbtn\"  onclick=\"RequestValue(document.getElementById('zbtxt').value,'" + xyzb + "','" + mbzname + "');\">";
	html = html + " <input id=\"zbtxt\" type=\"text\"  class=\"rangekw1\" size=\"19\" maxlength=\"100\"  autocomplete=\"off\"/>";
	html = html + "</div>";



	mapOerate.addPopup(mbzname, marker.lonlat.lon, marker.lonlat.lat, 200, 3000, true, html); //true 自动关闭上一个pop;	

}

function delbz() {

	mapOerate.delPopup();
	mapOerate.delIcon5();

}

function drawmyArea() {

	mapOerate.startSelectPolygon();
	mapOerate.drawArea(getpntlistAea);

}

function getpntlistAea(strPntList) {

	curPntList = strPntList;
	drawpoints.length = 0;

	var pointList = strPntList.split(';');

	for (var i = 0; i < pointList.length; i++) {

		var pointXY = pointList[i].split(',');
		if (pointXY.length == 2) {
			poi = new OpenLayers.Geometry.Point(pointXY[0], pointXY[1]);
			drawpoints.push(poi);
		}
	}


	if (drawpoints.length >= 2) {

		var html = "<div style=\"margin:0px;\">";

		html = html + "<p class=\"iw_poi_title\">标注面</p>";
		html = html + "</div>";
		html = html + " <table class=\"table_list_info\" cellspacing=\"0\">";
		html = html + " <tbody>";
		html = html + " <tr>";
		html = html + "<th> </th>";
		html = html + " <td style=\"height:20px\"></td>";
		html = html + " </tr>";
		html = html + " <tr>";
		html = html + " <tr><th>名称：</th>";
		html = html + "<td><input id=\"wtper\" type=\"text\"  class=\"biaozhutxt\"/></td>";
		html = html + " </tr>";
		html = html + " <tr>";
		html = html + "<th> </th>";
		html = html + " <td style=\"height:2px\"></td>";
		html = html + " </tr>";
		html = html + " <tr><th>备注：</th>";
		html = html + "<td><textarea id=\"wtmemo\" class=\"biaozhutxt\" style=\"height:60px\"></textarea></td>";
		html = html + " </tr>";
		html = html + " <tr>";
		html = html + "<th> </th>";
		html = html + " <td style=\"height:2px\"></td>";
		html = html + " </tr>";
		html = html + " <tr><th></th>";
		html = html + "<td><input id=\"subtn\" type=\"button\"  class=\"biaozhubtn\" onclick=\"saveArea();\"/>   <input id=\"subtn\" type=\"button\"  class=\"biaozhubtn1\" onclick=\"delbz();\"/></td>";
		html = html + " </tr>";
		html = html + " <tr>";
		html = html + "<th> </th>";
		html = html + " <td style=\"height:3px\"></td>";
		html = html + " </tr>";
		html = html + "</tbody>";
		html = html + " </table>";

		var measure = "河南省地图院";
		id = "456";

		out = '<div>' +
			'<label class=" BMapLabel BMap_disLabel" unselectable="on" style="float:left; display: inline; cursor: inherit; background-color: rgb(255, 255, 255); border: 1px solid rgb(255, 1, 3); padding: 3px 5px; white-space: nowrap; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: arial, simsun; z-index: 85; color: rgb(51, 51, 51); -webkit-user-select: none;">' +
			'<span class="BMap_disBoxDis">' + measure + '</span>' +
			'</label>' +
			'<div style="float:left; margin: 0px; padding: 0px; width: 12px; height: 12px; overflow: hidden;"><img style="cursor:pointer" onclick=savePolygon("' + id + '")' + ' src="images/close.png" class="celianClose"></div>' +
			'</div>';

		var midpoint = new OpenLayers.LonLat(drawpoints[0].x, drawpoints[0].y);
		var popup = new OpenLayers.Popup.Anchored(id, midpoint, null, html, {
			size: new OpenLayers.Size(15, 10),
			offset: new OpenLayers.Pixel(0, 0)
		}, false);
		///var popup = new OpenLayers.Popup.Anchored(id, midpoint, null, html, { size: new OpenLayers.Size(15, 10), offset: new OpenLayers.Pixel(0, 0) }, false);
		popup.contentDiv.className = "olAnchoredPopupContent";
		popup.autoSize = true;
		popup.minSize = new OpenLayers.Size(300, 240);
		popup.opacity = "1";
		popup.backgroundColor = "#fff";
		popup.backgroundColor = null;
		// map.addPopup(popup);

		mapOerate.addPopup("1", drawpoints[drawpoints.length - 1].x, drawpoints[drawpoints.length - 1].y, 330, 160, false, html); //true 自动关闭上一个pop;	



	}
	mapOerate.setMove();

}

function getScreenMarkers() {

	changeMapLayer();
	var bound = map.getExtent();
	var center = map.getCenter();
	var zoom = map.getZoom();
	var level = zoom + 1;

	if ($("#gzlx").val() != "" && level >= 10 && level <= 17) {

		showcs($("#gzlx").val(), 0, $("#gzid").val(), 1);
	}

}
///mtil 代表地图 mid代表是否加载专题
function showcs(mc, pageindx, mtil, mid) {

	$("#searchmapdiv").hide();
	delMyMarker();
	if (jpl != null) {
		map.removeLayer(jpl);
	}

	$("#gzlx").val(mc);
	$("#gzid").val(mtil);
	if (mid == '0') {

		mapOerate.delIcon3();
		if (mtil != '0') {

			drawgongzhong(mtil);
		} else {
			//  $("#gzlx").val('');
			////获取

			var testlink1 = "";
			testlink1 = "mc=" + mc;
			$.ajax({
				type: "POST", //用POST方式传输
				async: true,
				dataType: "json",
				url: "Handler/gongzhong.ashx", //目标地址 
				data: testlink1,
				success: function(json) {

					var productData = json.listgz;
					$.each(productData, function(i, n) {
						addMyMarker3(n.NAME, n.POINT_X, n.POINT_Y);
					});
				}
			});

		}
	}
	var ggpagesize = 10;
	ggcurrpage = pageindx;
	mingzi = mc;

	var mssfl = "";
	var tbody = "";
	var toptable = "<table style=\"width: 100%; background-color: #fff;\">";
	var endtable = "</table>";
	var trs = "";
	var str = "";
	var mfw = "";
	mfw = getExtent(); ///范围
	var strlist = mfw.split(",");
	var x1 = strlist[0];
	var x2 = strlist[2];
	var y1 = strlist[1];
	var y2 = strlist[3];

	var testlink = "";
	if (x1 != "" && x1 != null && typeof(x1) != "undefined") {

		testlink = "mc=" + mc + "&x1=" + x1 + "&x2=" + x2 + "&y1=" + y1 + "&y2=" + y2 + "&p=" + ggcurrpage + "&pz=10";
	}
	$("#searchmapdiv").show();
	$("#indexdiv").hide();
	var jsonstr = "";

	$.ajax({
		type: "POST", //用POST方式传输
		async: true,
		dataType: "json",
		url: "Handler/csyx.ashx", //目标地址 
		data: testlink,
		success: function(json) {

			$("#ResultPanelDIV").html("");
			ggInitPage();
			ggrowcount = json.TOTAL;
			ggRowCount();
			$("#countinfo").html(" 共" + ggrowcount + "条记录");
			var productData = json.dslist;
			$.each(productData, function(i, n) {

				jsonstr = "{'id':'" + n.id + "','NAME':'" + n.NAME + "','ssds':'" + n.NAME + "','XZQ':'" + n.NAME + "','x':'" + n.POINT_X + "','y':'" + n.POINT_Y + "'}";
				var trs = ""
				var mfl = ""
				var pageimg = i + 1;
				trs += " <tr>";
				trs += "  <td>";
				trs += "   <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" height=\"40px\">";
				trs += "  <tr>";
				trs += " <td width=\"42\" rowspan=\"1\" valign=\"middle\"> <img src=\"image/poi/red-" + pageimg + ".png\"  id=\"poi" + pageimg + "\"/></td>";
				trs += "<td width=\"160\" class=\"searchtitle\" valign=\"middle\"><a href='javascript:;' onclick=\"addMyMarkerGG(" + jsonstr + "," + pageimg + ");\">";
				trs += n.NAME;
				trs += "</a></td>";
				trs += " <td width=\"140\"  class=\"searchtitle\"  valign=\"middle\"></td>";
				trs += " </tr>";
				trs += "</table>";
				trs += "</td>";
				trs += "</tr>";
				tbody += trs;
				addMyMarker5(n.NAME, n.POINT_X, n.POINT_Y, mc);
			});
			tbody = toptable + tbody + endtable;
			$("#ResultPanelDIV").append(tbody);


		}
	});
}

function ggInitPage() {

	$("#infopage11").html("");
	var nowpageshow = "";
	nowpageshow = nowpageshow + "<div stfle=\"float: left; margin-left: 50px;\">";
	nowpageshow = nowpageshow + "<a class=\"disabled\" href=\"javascript:;\" onclick=\"ggFirst();\" stfle=\"color: #3372A2\">首页</a>&nbsp;&nbsp;";
	nowpageshow = nowpageshow + "<a class=\"disabled\" href=\"javascript:;\" onclick=\"ggPrve();\" stfle=\"color: #3372A2\">上一页</a>&nbsp;&nbsp;";
	nowpageshow = nowpageshow + "<a class=\"disabled\" href=\"javascript:;\" onclick=\"ggNext();\" stfle=\"color: #3372A2\">下一页</a>&nbsp;&nbsp;";
	nowpageshow = nowpageshow + "<a class=\"disabled\" href=\"javascript:;\" onclick=\"ggEnd();\" stfle=\"color: #3372A2\">末页</a>&nbsp;&nbsp;";
	nowpageshow = nowpageshow + " </div>";
	$("#infopage").append(nowpageshow);
}



//上一页
function ggPrve() {
	//  $("#ResultPanelDIV").remove();
	if (ggcurrpage > 0)
		ggcurrpage = ggcurrpage - 1;
	showcs($("#gzlx").val(), ggcurrpage, $("#gzid").val(), 1);
}
//下一页
function ggNext() {
	//   $("#ResultPanelDIV").remove();
	if (ggcurrpage < ggpagecount - 1)
		ggcurrpage = parseInt(ggcurrpage) + 1;
	ggInitPage(ggcurrpage);
	showcs($("#gzlx").val(), ggcurrpage, $("#gzid").val(), 1);
}

//首页
function ggFirst() {
	//   $("#ResultPanelDIV").remove();
	ggcurrpage = 0;
	showcs($("#gzlx").val(), ggcurrpage, $("#gzid").val(), 1);
}

//尾页
function ggEnd() {
	//   $("#ResultPanelDIV").remove();
	ggcurrpage = ggpagecount - 1;
	showcs($("#gzlx").val(), ggcurrpage, $("#gzid").val(), 1);
}

function ggRowCount() {
	//alert(ggrowcount);
	ggpagecount = parseInt(ggrowcount / 10);
	if (ggrowcount % parseInt(ggpagesize) > 0) {
		ggpagecount = ggpagecount + 1;
	}

}

function getExtent() {

	var bound = map.getExtent();
	var boundext = "";
	boundext = bound.left + "," + bound.bottom + "," + bound.right + "," + bound.top;
	return boundext;


}


/////////公众出行
function getMyMarkerGG(evt) {

	var xyzb = this.xx + "," + this.yy;

	var html = "<div style=\"margin:0px;\">";

	html = html + "<p class=\"iw_poi_title\">" + this.name + "</p>";

	html = html + "</div>";
	html = html + "<div class=\"BMap_bubble_center\">";
	html = html + "<div style=\"width: 346px;\" class=\"BMap_bubble_content\">";
	html = html + "<div class=\"iw_poi_conTop\">";
	html = html + "<div class=\"iw_poi_content iw_poi_content_search\" >";
	html = html + " <table class=\"table_list_info\" cellspacing=\"0\">";
	html = html + " <tbody>";
	html = html + " <tr>";
	html = html + "<th> </th>";
	html = html + " <td style=\"height:20px\"></td>";
	html = html + " </tr>";
	html = html + "</tbody>";
	html = html + " </table>";
	html = html + "</div>";
	html = html + " <div class=\"iw_btn_con\"></div>";
	html = html + " </div>";
	html = html + "<div id=\"ucCtrl\" class=\"ucCtrl\">";
	html = html + " <div class=\"ctrl\">";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "<div class=\"iw_poi_inter\" id=\"iw_poi_inter\">";
	html = html + " <ul class=\"nav_tab\">";
	html = html + " <li id=\"nav_tab2\" class=\"blueA hover\" onclick=\"PoPSwitch(2);\">";
	html = html + " <img src=\"image/poi/zb1.png\" align=\"absmiddle\"  style=\"height:14px;width:14px\"/> 在附近找";
	html = html + "</li>";
	html = html + " <li id=\"nav_tab0\" class=\"blueA \" onclick=\"PoPSwitch(0);\">";
	html = html + "  <img src=\"image/poi/zb2.png\" align=\"absmiddle\"  style=\"height:15px;width:10px\"/>到这里去</li>";
	html = html + " <li id=\"nav_tab1\" class=\"blueA \" onclick=\"PoPSwitch(1);\">";
	html = html + " <img src=\"image/poi/zb3.png\" align=\"absmiddle\"  style=\"height:15px;width:10px\"/>从这里出发</li>";
	html = html + " </ul>";

	html = html + " <div id=\"iw_tab0\" class=\"nav_tab_content\" style=\"display:none\">";
	html = html + " <div>";
	html = html + " <span class=\"lef\">起点</span>";
	html = html + " <span id=\"iw_ssnSpan\" class=\"iw_txt_wrap\">";
	html = html + "<input id=\"zbstart\" type=\"text\" width=\"50px\" class=\"rangekw\"/>";
	html = html + " </span>";
	html = html + " <input id=\"iw_ssb_btn\" type=\"button\" value=\"公交\" class=\"searchbtn\"  onclick=\"ZbSearch(document.getElementById('zbstart').value,'" + this.name + "');\">";
	html = html + " &nbsp;&nbsp;<input id=\"iw_ssd_btn\"  type=\"button\" value=\"驾车\" class=\"searchbtn\"   onclick=\"ZbZjSearch(document.getElementById('zbstart').value,'" + this.name + "');\"/>";
	html = html + " </div>";
	html = html + " </div>";

	html = html + " <div id=\"iw_tab1\" class=\"nav_tab_content\" style=\"display:none\">";
	html = html + " <div>";
	html = html + " <span class=\"lef\">终点</span>";
	html = html + " <span id=\"iw_esnSpan\" class=\"iw_txt_wrap\"><input id=\"zbjcstart\" type=\"text\" width=\"50px\" class=\"rangekw\"/>";
	html = html + " </span>";
	html = html + " <input id=\"iw_esb_btn\" type=\"button\" value=\"公交\" class=\"searchbtn\"  onclick=\"ZbSearch('" + this.name + "',document.getElementById('zbjcstart').value);\">";
	html = html + " &nbsp;&nbsp;<input id=\"iw_esd_btn\"  type=\"button\" value=\"驾车\" class=\"searchbtn\"  onclick=\"ZbZjSearch('" + this.name + "',document.getElementById('zbjcstart').value);\">";
	html = html + " </div>";
	html = html + " </div>";

	html = html + " <div id=\"iw_tab2\" class=\"nav_tab_content\" style=\"display:block\">";
	html = html + " <div class=\"iw_cate_list\">";
	html = html + " <a href=\"javascript:;\" onclick=\"RequestValue('银行','" + xyzb + "','" + this.name + "');\">银行</a>";
	html = html + " <a href=\"javascript:;\"  onclick=\"RequestValue('酒店','" + xyzb + "','" + this.name + "');\">酒店</a>";
	html = html + " <a href=\"javascript:;\" onclick=\"RequestValue('超市','" + xyzb + "','" + this.name + "');\">超市</a>";
	html = html + " </div>";
	html = html + " <div class=\"iw_cate_form\">";
	html = html + " <input tid=\"iwNSBtn\" type=\"button\" value=\"搜索\" class=\"searchbtn\"  onclick=\"RequestValue(document.getElementById('zbtxt').value,'" + xyzb + "','" + this.name + "');\">";
	html = html + " <input id=\"zbtxt\" type=\"text\"  class=\"rangekw1\" size=\"19\" maxlength=\"100\"  autocomplete=\"off\"/>";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "</div>";


	mapOerate.addPopup("1", this.xx, this.yy, 330, 160, true, html); //true 自动关闭上一个pop;	

}

function addMyMarkerGG(n, i) {
	var json = n;

	var xyzb = json.x + "," + json.y;

	var html = "<div style=\"margin:0px;\">";

	html = html + "<p class=\"iw_poi_title\">" + json.NAME + "</p>";

	html = html + "</div>";
	html = html + "<div class=\"BMap_bubble_center\">";
	html = html + "<div style=\"width: 346px;\" class=\"BMap_bubble_content\">";
	html = html + "<div class=\"iw_poi_conTop\">";
	html = html + "<div class=\"iw_poi_content iw_poi_content_search\" >";
	html = html + " <table class=\"table_list_info\" cellspacing=\"0\">";
	html = html + " <tbody>";
	html = html + " <tr>";
	html = html + "<th> </th>";
	html = html + " <td style=\"height:20px\"></td>";
	html = html + " </tr>";
	html = html + "</tbody>";
	html = html + " </table>";
	html = html + "</div>";
	html = html + " <div class=\"iw_btn_con\"></div>";
	html = html + " </div>";
	html = html + "<div id=\"ucCtrl\" class=\"ucCtrl\">";
	html = html + " <div class=\"ctrl\">";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "<div class=\"iw_poi_inter\" id=\"iw_poi_inter\">";
	html = html + " <ul class=\"nav_tab\">";
	html = html + " <li id=\"nav_tab2\" class=\"blueA hover\" onclick=\"PoPSwitch(2);\">";
	html = html + " <img src=\"image/poi/zb1.png\" align=\"absmiddle\"  style=\"height:14px;width:14px\"/> 在附近找";
	html = html + "</li>";
	html = html + " <li id=\"nav_tab0\" class=\"blueA \" onclick=\"PoPSwitch(0);\">";
	html = html + "  <img src=\"image/poi/zb2.png\" align=\"absmiddle\"  style=\"height:15px;width:10px\"/>到这里去</li>";
	html = html + " <li id=\"nav_tab1\" class=\"blueA \" onclick=\"PoPSwitch(1);\">";
	html = html + " <img src=\"image/poi/zb3.png\" align=\"absmiddle\"  style=\"height:15px;width:10px\"/>从这里出发</li>";
	html = html + " </ul>";

	html = html + " <div id=\"iw_tab0\" class=\"nav_tab_content\" style=\"display:none\">";
	html = html + " <div>";
	html = html + " <span class=\"lef\">起点</span>";
	html = html + " <span id=\"iw_ssnSpan\" class=\"iw_txt_wrap\">";
	html = html + "<input id=\"zbstart\" type=\"text\" width=\"50px\" class=\"rangekw\"/>";
	html = html + " </span>";
	html = html + " <input id=\"iw_ssb_btn\" type=\"button\" value=\"公交\" class=\"searchbtn\"  onclick=\"ZbSearch(document.getElementById('zbstart').value,'" + json.NAME + "');\">";
	html = html + " &nbsp;&nbsp;<input id=\"iw_ssd_btn\"  type=\"button\" value=\"驾车\" class=\"searchbtn\"   onclick=\"ZbZjSearch(document.getElementById('zbstart').value,'" + json.NAME + "');\"/>";
	html = html + " </div>";
	html = html + " </div>";

	html = html + " <div id=\"iw_tab1\" class=\"nav_tab_content\" style=\"display:none\">";
	html = html + " <div>";
	html = html + " <span class=\"lef\">终点</span>";
	html = html + " <span id=\"iw_esnSpan\" class=\"iw_txt_wrap\"><input id=\"zbjcstart\" type=\"text\" width=\"50px\" class=\"rangekw\"/>";
	html = html + " </span>";
	html = html + " <input id=\"iw_esb_btn\" type=\"button\" value=\"公交\" class=\"searchbtn\"  onclick=\"ZbSearch('" + json.NAME + "',document.getElementById('zbjcstart').value);\">";
	html = html + " &nbsp;&nbsp;<input id=\"iw_esd_btn\"  type=\"button\" value=\"驾车\" class=\"searchbtn\"  onclick=\"ZbZjSearch('" + json.NAME + "',document.getElementById('zbjcstart').value);\">";
	html = html + " </div>";
	html = html + " </div>";

	html = html + " <div id=\"iw_tab2\" class=\"nav_tab_content\" style=\"display:block\">";
	html = html + " <div class=\"iw_cate_list\">";
	html = html + " <a href=\"javascript:;\" onclick=\"RequestValue('银行','" + xyzb + "','" + json.NAME + "');\">银行</a>";
	html = html + " <a href=\"javascript:;\"  onclick=\"RequestValue('酒店','" + xyzb + "','" + json.NAME + "');\">酒店</a>";
	html = html + " <a href=\"javascript:;\" onclick=\"RequestValue('超市','" + xyzb + "','" + json.NAME + "');\">超市</a>";
	html = html + " </div>";
	html = html + " <div class=\"iw_cate_form\">";
	html = html + " <input tid=\"iwNSBtn\" type=\"button\" value=\"搜索\" class=\"searchbtn\"  onclick=\"RequestValue(document.getElementById('zbtxt').value,'" + xyzb + "','" + json.NAME + "');\">";
	html = html + " <input id=\"zbtxt\" type=\"text\"  class=\"rangekw1\" size=\"19\" maxlength=\"100\"  autocomplete=\"off\"/>";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "</div>";

	//mapOerate.setCenter(json.x, json.y);
	//mapOerate.map.zoomTo(13);
	mapOerate.addPopup("1", json.x, json.y, 330, 160, true, html); //true 自动关闭上一个pop;	
}

function addMyMarker5(name, xx, yy, mc) {
	//  mapOerate.setCenter(xx, yy);
	//alert(name);
	//mapOerate.map.zoomTo(15);

	mapOerate.addIcon1(name, "image/dot3.png", "image/dot4.png", xx, yy, 21, 31, -10, -30, getMyMarkerGG);

}

function addMyMarker3(name, xx, yy) {

	mapOerate.addIcon3(name, "image/dot.png", "image/dot.png", xx, yy, 10, 10, -5, -5, "", getgg);

}

function getgg() {


}

function drawgongzhong(mid) {
	//    mapOerate.map.zoomTo(10);
	//    var newmapoptions = {
	//        name: "diandituhenan",
	//        url: "http://221.13.205.235:8719/newmap/tianditu/diandituhenan/tollstation/wmts",
	//        layer: "tollstation",
	//        style: "default",
	//        format: "image/png",
	//        matrixIds: matrixIds,
	//        zoomOffset: 1,
	//        matrixSet: "TileMatrixSet_0",
	//        buffer: 0,
	//        resolutions: resolutions
	//    };

	//    var newmap_vec = new OpenLayers.Layer.WMTS(newmapoptions);
	//    newmap_vec.setIsBaseLayer(false);
	//    map.addLayer(newmap_vec);


}
///划线
function drawmyline() {
	delMyMarker();
	mapOerate.startSelectLine();
	drawpoints.length = 0;
	mapOerate.drawLine(getpntlist);
}

function selectLine() {
	mapOerate.startSelectLine();
}

function stopLine() {
	mapOerate.endSelectLine();

}

function getpntlist(strPntList) {


	curPntList = strPntList;


	var pointList = strPntList.split(';');

	for (var i = 0; i < pointList.length; i++) {

		var pointXY = pointList[i].split(',');
		if (pointXY.length == 2) {
			poi = new OpenLayers.Geometry.Point(pointXY[0], pointXY[1]);
			drawpoints.push(poi);
		}
	}

	if (drawpoints.length >= 2) {

		var measure = "河南省地图院";
		id = "456";

		var html = "<div style=\"margin:0px;\">";
		html = html + "<p >标注线</p>";
		html = html + "</div>";
		html = html + "<div class=\"BMap_bubble_center\">";
		html = html + "<div style=\"width: 346px;\" class=\"BMap_bubble_content\">";
		html = html + "<div class=\"iw_poi_conTop\">";
		html = html + "<div class=\"iw_poi_content iw_poi_content_search\" >";
		html = html + " <table class=\"table_list_info\" cellspacing=\"0\">";
		html = html + " <tbody>";
		html = html + " <tr>";
		html = html + "<th> </th>";
		html = html + " <td style=\"height:20px\"></td>";
		html = html + " </tr>";

		html = html + " <tr>";
		html = html + " <tr><th>名称：</th>";
		html = html + "<td><input id=\"wtper\" type=\"text\"  class=\"biaozhutxt\"/></td>";
		html = html + " </tr>";
		html = html + " <tr>";
		html = html + "<th> </th>";
		html = html + " <td style=\"height:2px\"></td>";
		html = html + " </tr>";
		html = html + " <tr><th>备注：</th>";
		html = html + "<td><textarea id=\"wtmemo\" class=\"biaozhutxt\" style=\"height:60px\"></textarea></td>";
		html = html + " </tr>";
		html = html + " <tr>";
		html = html + "<th> </th>";
		html = html + " <td style=\"height:2px\"></td>";
		html = html + " </tr>";
		html = html + " <tr><th></th>";
		html = html + "<td><input id=\"subtn\" type=\"button\"  class=\"biaozhubtn\" onclick=\"saveLine();\"/>   <input id=\"subtn\" type=\"button\"  class=\"biaozhubtn1\" onclick=\"delbz();\"/></td>";
		html = html + " </tr>";
		html = html + " <tr>";
		html = html + "<th> </th>";
		html = html + " <td style=\"height:3px\"></td>";
		html = html + " </tr>";
		html = html + "</tbody>";
		html = html + "</div>";
		html = html + "</div>";
		html = html + "</div>";
		html = html + "</div>";
		html = html + " </table>";

		var midpoint = new OpenLayers.LonLat(drawpoints[0].x, drawpoints[0].y);
		var popup = new OpenLayers.Popup.Anchored(id, midpoint, null, html, {
			size: new OpenLayers.Size(15, 10),
			offset: new OpenLayers.Pixel(0, 0)
		}, false);
		popup.contentDiv.className = "olAnchoredPopupContent";
		popup.autoSize = true;
		popup.minSize = new OpenLayers.Size(300, 240);
		popup.opacity = "1";
		popup.backgroundColor = "#fff";
		popup.backgroundColor = null;
		// map.addPopup(popup);
		mapOerate.addPopup("1", drawpoints[drawpoints.length - 1].x, drawpoints[drawpoints.length - 1].y, 330, 160, false, html); //true 自动关闭上一个pop;	

	}

	mapOerate.setMove();

}

function saveLine() {

	mapOerate.dleTempLine();

	style_green = {
		strokeColor: "#0000FF",
		strokeOpacity: 0.8,
		strokeWidth: 7,
		pointRadius: 2,
		strokeDashstyle: "solid", //'dot': 'dash': 'dashdot':'longdash':ongdashdot':

		pointerEvents: "visiblePainted"
	};

	var feature = mapOerate.addLine(drawpoints, style_green, selectmyLine);
	mbzname = $("#wtper").val();
	mbzbeizhu = $("#wtmemo").val();
	CloseXinXi();
	feature.id = mbzname;
	feature.layer.redraw();


	//    mapOerate.zoomIn();

}


function selectmyLine(feature) {
	var xyzb = drawpoints[drawpoints.length - 1].x + "," + drawpoints[drawpoints.length - 1].y;
	var html = "<div style=\"margin:0px;\">";

	html = html + "<p class=\"iw_poi_title\">" + mbzname + "</p>";

	html = html + "<img class='shouc' src=\"Image/poi/save.png\" style=\"cursor:hand;\" title=\"收藏\" onclick='saveline();'>";
	html = html + "<img class='shouc' src=\"Image/poi/del.png\" style=\"cursor:hand;\" title=\"删除\" onclick='delbz();'>";

	html = html + "</div>";
	html = html + "<div class=\"BMap_bubble_center\">";
	html = html + "<div style=\"width: 346px;\" class=\"BMap_bubble_content\">";
	html = html + "<div class=\"iw_poi_conTop\">";
	html = html + "<div class=\"iw_poi_content iw_poi_content_search\" >";
	html = html + " <table class=\"table_list_info\" cellspacing=\"0\">";
	html = html + " <tbody>";
	html = html + " <tr>";
	html = html + "<th> </th>";
	html = html + " <td style=\"height:20px\"></td>";
	html = html + " </tr>";
	html = html + " <tr>";
	html = html + " <tr>";
	html = html + "<th> </th>";
	html = html + " <td style=\"height:2px\"></td>";
	html = html + " </tr>";
	html = html + " <tr>";
	html = html + "<th> </th>";
	html = html + " <td style=\"height:2px\"></td>";
	html = html + " </tr>";
	html = html + " <tr>";
	html = html + "<td>" + mbzbeizhu + "</td>";
	html = html + " </tr>";

	html = html + " <tr>";
	html = html + "<th> </th>";
	html = html + " <td style=\"height:3px\"></td>";
	html = html + " </tr>";
	html = html + "</tbody>";
	html = html + " </table>";
	html = html + "</div>";
	html = html + " <div class=\"iw_btn_con\"></div>";
	html = html + " </div>";
	html = html + "<div id=\"ucCtrl\" class=\"ucCtrl\">";
	html = html + " <div class=\"ctrl\">";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "<div class=\"iw_poi_inter\" id=\"iw_poi_inter\">";
	html = html + " <ul class=\"nav_tab\">";
	html = html + " <li id=\"nav_tab2\" class=\"blueA hover\" onclick=\"PoPSwitch(2);\">";
	html = html + " <img src=\"image/poi/zb1.png\" align=\"absmiddle\"  style=\"height:14px;width:14px\"/> 在附近找";
	html = html + "</li>";
	html = html + " <li id=\"nav_tab0\" class=\"blueA \" onclick=\"PoPSwitch(0);\">";
	html = html + "  <img src=\"image/poi/zb2.png\" align=\"absmiddle\"  style=\"height:15px;width:10px\"/>到这里去</li>";
	html = html + " <li id=\"nav_tab1\" class=\"blueA \" onclick=\"PoPSwitch(1);\">";
	html = html + " <img src=\"image/poi/zb3.png\" align=\"absmiddle\"  style=\"height:15px;width:10px\"/>从这里出发</li>";
	html = html + " </ul>";

	html = html + " <div id=\"iw_tab0\" class=\"nav_tab_content\" style=\"display:none\">";
	html = html + " <div>";
	html = html + " <span class=\"lef\">起点</span>";
	html = html + " <span id=\"iw_ssnSpan\" class=\"iw_txt_wrap\">";
	html = html + "<input id=\"zbstart\" type=\"text\" width=\"50px\" class=\"rangekw\"/>";
	html = html + " </span>";
	html = html + " <input id=\"iw_ssb_btn\" type=\"button\" value=\"公交\" class=\"searchbtn\"  onclick=\"ZbSearch(document.getElementById('zbstart').value,'" + mbzname + "');\">";
	html = html + " &nbsp;&nbsp;<input id=\"iw_ssd_btn\"  type=\"button\" value=\"驾车\" class=\"searchbtn\"   onclick=\"ZbZjSearch(document.getElementById('zbstart').value,'" + mbzname + "');\"/>";
	html = html + " </div>";
	html = html + " </div>";

	html = html + " <div id=\"iw_tab1\" class=\"nav_tab_content\" style=\"display:none\">";
	html = html + " <div>";
	html = html + " <span class=\"lef\">终点</span>";
	html = html + " <span id=\"iw_esnSpan\" class=\"iw_txt_wrap\"><input id=\"zbjcstart\" type=\"text\" width=\"50px\" class=\"rangekw\"/>";
	html = html + " </span>";
	html = html + " <input id=\"iw_esb_btn\" type=\"button\" value=\"公交\" class=\"searchbtn\"  onclick=\"ZbSearch('" + mbzname + "',document.getElementById('zbjcstart').value);\">";
	html = html + " &nbsp;&nbsp;<input id=\"iw_esd_btn\"  type=\"button\" value=\"驾车\" class=\"searchbtn\"  onclick=\"ZbZjSearch('" + mbzname + "',document.getElementById('zbjcstart').value);\">";
	html = html + " </div>";
	html = html + " </div>";

	html = html + " <div id=\"iw_tab2\" class=\"nav_tab_content\" style=\"display:block\">";
	html = html + " <div class=\"iw_cate_list\">";
	html = html + " <a href=\"javascript:;\" onclick=\"RequestValue('银行','" + xyzb + "','" + mbzname + "');\">银行</a>";
	html = html + " <a href=\"javascript:;\"  onclick=\"RequestValue('酒店','" + xyzb + "','" + mbzname + "');\">酒店</a>";
	html = html + " <a href=\"javascript:;\" onclick=\"RequestValue('超市','" + xyzb + "','" + mbzname + "');\">超市</a>";
	html = html + " </div>";
	html = html + " <div class=\"iw_cate_form\">";
	html = html + " <input tid=\"iwNSBtn\" type=\"button\" value=\"搜索\" class=\"searchbtn\"  onclick=\"RequestValue(document.getElementById('zbtxt').value,'" + xyzb + "','" + mbzname + "');\">";
	html = html + " <input id=\"zbtxt\" type=\"text\"  class=\"rangekw1\" size=\"19\" maxlength=\"100\"  autocomplete=\"off\"/>";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "</div>";
	html = html + "</div>";

	//  alert(feature.id + "||" + drawpoints[drawpoints.length - 1].x+"fazhaohui");
	mapOerate.addPopup(feature.id, drawpoints[drawpoints.length - 1].x, drawpoints[drawpoints.length - 1].y, 200, 3000, false, html); //true 自动关闭上一个pop;	

}

function saveArea() {

	mapOerate.dleTempPolygon();

	var feature = mapOerate.addPolygon(drawpoints, null, selectmyLine);
	mbzname = $("#wtper").val();
	mbzbeizhu = $("#wtmemo").val();
	CloseXinXi();
	feature.id = mbzname;
	feature.layer.redraw();
	mapOerate.startSelectPolygon();

}

function selectmyPolygon(feature) {

	alert(feature.id);
}

function dwds(xx, yy) {

	mapOerate.setCenter(xx, yy);
	mapOerate.map.zoomTo(10);

}

//-------------村庄弹出信息框------------------//
function addMyMarkerF(n, i) {
	var json = n;

	var xyzb = json.x + "," + json.y;

	var html = "<div style=\"margin:0px;\">";


	html = html + "<p class=\"iw_poi_title\">" + n.NAME + "<font style=\"font-size:12px; font-weight:normal;\">(" + n.ssds + n.XZQ + ")</font></p>";

	html = html + "</div>";
	html = html + "<div class=\"BMap_bubble_center\">";
	html = html + "<div style=\"width: 346px;\" class=\"BMap_bubble_content\">";
	html = html + "<div class=\"iw_poi_conTop\">";
	html = html + "<div class=\"iw_poi_content iw_poi_content_search\" >";
	html = html + " <table class=\"table_list_info\" cellspacing=\"0\">";
	html = html + " <tbody>";
	html = html + " <tr>";
	html = html + "<th> </th>";
	html = html + " <td style=\"height:20px\"></td>";
	html = html + " </tr>";
	html = html + "    <tr>";
	html = html + "        <td colspan=\"3\" style=\"line-height: 30px; height: 30px;\">";
	html = html + "            <table width=\"324px\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	html = html + "                <tr>";
	html = html + "                    <td align=\"center\" class=\"groundout\" id=\"ground1\" onclick=\"PoPSwitchF(1);\"><div style=\"text-align:center;\">";
	html = html + "                                       简  介";
	html = html + "                    </div></td>";
	html = html + "                    <td  align=\"center\"  class=\"groundon\" id=\"ground2\" onclick=\"PoPSwitchF(2);\"><div style=\"text-align:center;\">";
	html = html + "                                       经  济";
	html = html + "                    </div></td>";
	html = html + "                    <td align=\"center\"  class=\"groundon\" id=\"ground3\" onclick=\"PoPSwitchF(3);\"><div style=\"text-align:center;\">";
	html = html + "                                       村干部";
	html = html + "                   </div></td>";
	html = html + "                </tr>";

	html = html + "                <tr>";
	html = html + "                    <td colspan=\"3\" style=\"height: 300px; line-height: 30px\">";

	html = html + "                        <div id=\"rounddiv1\">";
	html = html + " <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	html = html + " <tr>";
	html = html + " <td>" + n.jianjie + "</td>";
	html = html + "  </tr>";
	html = html + " </table>";
	html = html + "                          </div>";


	html = html + "                        <div id=\"rounddiv2\" style=\"display:none;width:255px;\">";
	html = html + " <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	html = html + " <tr>";
	html = html + " <td>" + n.jingji + "</td>";
	html = html + "  </tr>";
	html = html + " </table>";
	html = html + "  </div>";


	html = html + "                        <div id=\"rounddiv3\"  style=\"display:none;width:255px;\">";
	html = html + " <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	html = html + " <tr>";
	html = html + " <td>";
	html = html + GetCunPic(n.id);

	html = html + " </td>";

	html = html + "  </tr>";
	html = html + " </table>";
	html = html + "  </div>";

	html = html + "                    </td>";
	html = html + "                </tr>";

	html = html + "</tbody>";
	html = html + " </table>";
	html = html + "</div>";
	html = html + " <div class=\"iw_btn_con\"></div>";
	html = html + " </div>";
	html = html + " </div>";
	html = html + " </div>";
	html = html + " </div>";
	html = html + " </div>";
	//mapOerate.setCenter(json.x, json.y);
	//mapOerate.map.zoomTo(13);
	mapOerate.addPopup("1", json.x, json.y, 330, 300, true, html); //true 自动关闭上一个pop;	
}

function addMyMarkerFW(n, xx, yy, mingzi, ssds, ssqx, dizhi, dianhua, zhaopian, jianjie, yid) {
	var x = (xx / 360000).toString().substring(0, 10);
	var y = (yy / 360000).toString().substring(0, 10);
	//mapOerate.setCenter(x, y);
	//mapOerate.map.zoomTo(13);
	mapOerate.addIcon4(mingzi, "image/poi/red-" + n + ".png", "image/poi/b-" + n + ".png", x, y, 24, 30, -12, -30, ssds, ssqx, dizhi, dianhua, zhaopian, jianjie, yid, getMyMarkerF);

}

//村庄信息弹出框
function getMyMarkerF(evt) {

	var xyzb = this.xx + "," + this.yy;

	var html = "<div style=\"margin:0px;\">";

	html = html + "<p>" + this.name + "<font style=\"font-size:12px; font-weight:normal;\">(" + this.ssds + this.ssqx + ")</font></p>";

	html = html + "</div>";

	html = html + " <table class=\"table_list_info\" cellspacing=\"0\">";
	html = html + " <tbody>";
	html = html + " <tr>";
	html = html + "<th> </th>";
	html = html + " <td style=\"height:20px\"></td>";
	html = html + " </tr>";
	html = html + "    <tr>";
	html = html + "        <td colspan=\"3\" style=\"line-height: 30px; height: 30px;\">";
	html = html + "            <table width=\"324px\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	html = html + "                <tr>";
	html = html + "                    <td class=\"groundout\" id=\"ground1\"  onclick=\"PoPSwitchF(1);\"><div style=\"text-align:center;\">";
	html = html + "                                             简 介";
	html = html + "                    </div></td>";
	html = html + "                    <td  class=\"groundon\" id=\"ground2\" onclick=\"PoPSwitchF(2);\"><div style=\"text-align:center;\">";
	html = html + "                                             经 济";
	html = html + "                   </div></td>";
	html = html + "                    <td  class=\"groundon\" id=\"ground3\" onclick=\"PoPSwitchF(3);\"><div style=\"text-align:center;\">";
	html = html + "                                              村干部";
	html = html + "                    </div></td>";
	html = html + "                </tr>";

	html = html + "                <tr>";
	html = html + "                    <td colspan=\"3\" style=\"height: 300px; line-height: 30px\">";

	html = html + "                        <div id=\"rounddiv1\">";
	html = html + " <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	html = html + " <tr>";
	html = html + " <td>" + this.jianjie + "</td>";
	html = html + "  </tr>";
	html = html + " </table>";
	html = html + "                          </div>";


	html = html + "                        <div id=\"rounddiv2\" style=\"display:none;width:220px;\">";
	html = html + " <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	html = html + " <tr>";
	html = html + " <td>" + this.jingji + "</td>";
	html = html + "  </tr>";
	html = html + " </table>";
	html = html + "  </div>";


	html = html + "                        <div id=\"rounddiv3\"  style=\"display:none;width:220px;\" >";
	html = html + " <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	html = html + " <tr>";
	html = html + " <td>";
	html = html + GetCunPic(this.yid);

	html = html + " </td>";

	html = html + "  </tr>";
	html = html + " </table>";
	html = html + "  </div>";

	html = html + "                    </td>";
	html = html + "                </tr>";
	html = html + "                </table>";




	mapOerate.addPopup("1", this.xx, this.yy, 330, 230, true, html); //true 自动关闭上一个pop;	

}



//视野内搜索村庄
function getScreenMarkers1() {

	changeMapLayer();
	var bound = map.getExtent();
	var center = map.getCenter();
	var zoom = map.getZoom();
	var level = zoom + 1;
	if (level >= 2 && level <= 17) {

		if (mapOerate != null) {

			delMyMarker();
		}
		InitDataF(0);
	}

}
//-------------标绘弹出信息点------------------//
function addMyMarkerBH(n, xx, yy, mingzi, ssds, ssqx) {

	if (n == 1) {
		mapOerate.setCenter(xx, yy);
		mapOerate.map.zoomTo(13);
	}
	mapOerate.addIcon2(mingzi, "image/poi/red-" + n + ".png", "image/poi/b-" + n + ".png", xx, yy, 24, 30, -12, -30, ssds, ssqx, getMyMarkerBH);

}

function addMyMarkerBHH(n, i) {
	var json = n;
	var xyzb = json.x + "," + json.y;
	var linpoly = json.linelength;


	var html = "<div style=\"margin:0px;\">";

	html = html + "<p class=\"iw_poi_title\">" + json.name + "</p>";

	html = html + "<div class=\"BMap_bubble_center\">";
	html = html + "<div style=\"width: 346px;\" class=\"BMap_bubble_content\">";
	html = html + "<div class=\"iw_poi_conTop\">";
	html = html + "<div class=\"iw_poi_content iw_poi_content_search\" >";
	html = html + " <table class=\"table_list_info\" cellspacing=\"0\">";
	html = html + " <tbody>";
	html = html + " <tr>";
	html = html + "<th> </th>";
	html = html + " <td style=\"height:20px\"></td>";
	html = html + " </tr>";
	html = html + " <tr>";
	html = html + "<th>详细信息：</th>";
	html = html + " <td>" + json.msg + "</td>";
	html = html + " </tr>";
	html = html + "</tbody>";
	html = html + " </table>";
	html = html + "</div>";

	html = html + " </div>";

	html = html + "</div>";
	html = html + "</div>";
	html = html + "</div>";

	html = html + "</div>";
	// html = html + "</div>";

	// mapOerate.setCenter(json.x, json.y);

	if (xyzb == ",") {
		clearmap();
		var pointList = linpoly.split(';');
		var drawpoints1 = [];
		for (var i = 0; i < pointList.length; i++) {

			var pointXY = pointList[i].split(',');
			if (pointXY.length == 2) {
				poi = new OpenLayers.Geometry.Point(pointXY[0], pointXY[1]);

				drawpoints1.push(poi);
			}
		}
		var style_green = {
			strokeColor: "#0000FF",
			strokeOpacity: 0.8,
			strokeWidth: 3,
			pointRadius: 2,
			strokeDashstyle: "solid", //'dot': 'dash': 'dashdot':'longdash':ongdashdot':

			pointerEvents: "visiblePainted"
		};
		var id = "789";
		mapOerate.addLine(drawpoints1, style_green);
		var midpoint = new OpenLayers.LonLat(drawpoints1[0].x, drawpoints1[0].y);
		var popup = new OpenLayers.Popup.Anchored(id, midpoint, null, html, {
			size: new OpenLayers.Size(15, 10),
			offset: new OpenLayers.Pixel(0, 0)
		}, false);
		popup.contentDiv.className = "olAnchoredPopupContent";
		popup.autoSize = true;
		popup.minSize = new OpenLayers.Size(300, 240);
		popup.opacity = "1";
		popup.backgroundColor = "#fff";
		popup.backgroundColor = null;
		// map.addPopup(popup);
		mapOerate.addPopup("1", drawpoints1[drawpoints1.length - 1].x, drawpoints1[drawpoints1.length - 1].y, 330, 160, false, html); //true 自动关闭上一个pop;

	} else {

		mapOerate.setCenter(json.x, json.y);
		mapOerate.addPopup("1", json.x, json.y, 330, 160, true, html); //true 自动关闭上一个pop;	
	}

	// mapOerate.map.zoomTo(13);
	///  mapOerate.addPopup("1", json.x, json.y, 330, 160, true, html); //true 自动关闭上一个pop;	
}

function loadtuceng(nname) {


	if (tucenglayer) {

		map.removeLayer(tucenglayer);
	}

	tucenglayer = null;

	var newmapoptionsmian = {
		name: "",
		url: "http://pytdt.hnchj.com/newmapserver4/tianditu/puyang/" + nname + "/wmts",
		layer: "base",
		style: "default",
		format: "image/png",
		matrixIds: matrixIds,
		zoomOffset: 1,
		matrixSet: "TileMatrixSet_0",
		buffer: 0,
		resolutions: resolutions
	};

	tucenglayer = new OpenLayers.Layer.WMTS(newmapoptionsmian);
	tucenglayer.setIsBaseLayer(false);

	tucenglayer.transitionEffect = '';
	map.addLayer(tucenglayer);

}